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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.7
    • Fix Version/s: 0.9
    • Component/s: PHP - Library
    • Labels:
    • Environment:

      PHP 5.2.6

    • Patch Info:
      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.ORIG
          14 kB
          Bryan Alves
        2. thrift_mbstring.patch
          15 kB
          Bryan Alves

          Activity

            People

            • Assignee:
              bryanalves Bryan Alves
              Reporter:
              bryanalves Bryan Alves
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: