Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong value of Content-Length when mbstring.func_overload is enabled #84

Open
n0guest opened this issue Mar 11, 2016 · 0 comments
Open

Comments

@n0guest
Copy link

n0guest commented Mar 11, 2016

Hi.

I've found a small bug when mbstring.func_overload=2. In parameters of xhprof_generate_mime_header function you're passing length as return of strlen($content). For example here https://github.com/phacility/xhprof/blob/master/xhprof_lib/utils/callgraph_utils.php#L484.

And return value of strlen($content) will differ (from real size of string in bytes) if mbstring.func_overload=2 and mbstring.internal_encoding='utf-8'. Such combination will cause "wrong" length and will cut off part of callgraph image. In result callgraph image will be downloaded only partially and only part of image will be shown in browser (checked in Google Chrome).

I'm not sure about "right way" to fix it, but in my example it can be easily fixed via replacing call of strlen($content) with call of mb_strlen($content, '8bit').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant