Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-8238

Infinite loop in truncate_string

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 3.0.5
    • 3.0.x
    • Posting
    • None
    • PHP Environment: 5.2.6
      Database: MySQL 5.0.37

      The function truncate_string will be trapped in an infinite loop, when given a half-baked non-unicode string. The attachment is a script to trigger the infinite loop.

      Fix:
      change
      while (utf8_strlen($string) > $max_store_length || !sizeof($chars));
      to
      while (utf8_strlen($string) > $max_store_length || sizeof($chars));

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

              Created:
              Updated:
              Resolved: