Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1427

PHP library uses non-multibyte safe functions with mbstring function overloading

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.7
    • 0.9
    • PHP - Library
    • PHP 5.2.6

    • Patch Available

    Description

      The PHP library uses strlen() and substr() liberally. These functions can be overriden by mbstring with the config "mbstring.func_overload" (http://us.php.net/manual/en/mbstring.overload.php).

      When this overloading happens, substr and strlen (among other non-important functions) are no longer binary-safe, and need to be replaced with their mb_* binary safe equivalents.

      Attached is a patch that identifies environments where mbstring.func_overloading is set, and automatically switches over use of the non-binarysafe functions to their safe equivalents.

      Attachments

        1. thrift_mbstring.patch
          15 kB
          Bryan Alves
        2. thrift_mbstring.patch.ORIG
          14 kB
          Bryan Alves

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            bryanalves Bryan Alves
            bryanalves Bryan Alves
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment