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

make_clickable multi-byte substring error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • 3.1.4-RC1
    • 3.0.12
    • Posting
    • None

      If you try to post url with non-latin symbols (example:
      https://ru.wikipedia.org/wiki/Миллиган,_Билли ) you get an error.
      Solution:

      file: /includes/functions_content.php
      function: make_clickable_callback
      string:
      $short_url = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url;

      replace with multi-byte versions:
      $short_url = (mb_strlen($url) > 55) ? mb_substr($url, 0, 39) . ' ... ' . mb_substr($url, -10) : $url;

            bantu Andreas Fischer [X] (Inactive)
            olkpeas olkpeas [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: