Skip to content

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

@n0guest

Description

@n0guest

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').

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions