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

Outdated call to preg_replace with e modifier breaks custom BBCode creation in HHVM and PHP 7+

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.1.8
    • BBCode Engine
    • HHVM Version 3.12.1 (PHP Version 5.6.99-hhvm)

      In acp_bbcodes.php, there is a call to preg_replace using the e modifier that breaks the token- incrementing loop, naturally resulting in all tokens beyond the first being left at $1 and replaced with original first token's value during use.

      Because of the type of issue, please note this only happens on codes that use 2+ tokens. Built in and single tokens continue to work as intended.

      I have offered a fix for this issue in this thread which works flawlessly on my test box.

      Note also I have listed my HHVM in the environment section, but as of vanilla PHP version 5.5, the e modifier was depreciated, and as of PHP 7 it is completely removed.

      Also I marked priority as minor as it doesn't happen with the most used versions of PHP, but I would consider custom bbcodes not working to be a major issue given their level of use.

            Marc Marc
            mewzi mewzi [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: