Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-17188

Condition to check if a utf8 string is malformed is wrong

    XMLWordPrintable

Details

    • Improvement
    • Status: Unverified Fix (View Workflow)
    • Minor
    • Resolution: Fixed
    • 4.0.0-a1, 3.3.11
    • 3.3.11
    • None
    • None

    Description

      In the class type_cast_helper there is a condition to check if a utf8 string is malformed

                          if (!preg_match('/^./u', $result))
                          {
                              $result = '';
                          } 

      But is causing false positives with some inputs.

       

      Possible solutions:

      https://stackoverflow.com/questions/6723562/how-can-i-detect-a-malformed-utf-8-string-in-php

       

      Attachments

        Activity

          People

            rubencm rubencm
            rubencm rubencm
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: