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

Wrong parameter for preg_replace() function.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 3.0.x
    • 3.0.3
    • Search
    • None
    • PHP Environment: 5.3.0a1
      Database:

    Description

      Yeah, this bug exists in phpBB 3.x for a long time, but actually it appears only when running under PHP 5.3.x and newer one.

      includes/functions_content.php (get_context() function, line 240)

          // first replace all whitespaces with single spaces    $text = preg_replace('/ +/', ' ', strtr($text, "\t\n\r\x0C ", '     '), $text); 

      should be:

          // first replace all whitespaces with single spaces    $text = preg_replace('/ +/', ' ', strtr($text, "\t\n\r\x0C ", '     '), utf8_strlen($text)); 

      AFAIK PHP 5.3 has more restrictive functions parameters mechanism, that's why previous PHP versions have never reported about the fact, that a string instead of a long is passed to the function. This issue also makes the text of a post not display in search results, when running under PHP 5.3.

      Attachments

        Activity

          People

            Acyd Burn Meik Sievertsen [X] (Inactive)
            faw faw
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: