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

Allow extensions using custom bbcode validation methods

    Details

    • Type: Improvement
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.3, 3.2.0-dev
    • Fix Version/s: 3.1.5-RC1
    • Component/s: Events, Extensions
    • Labels:
      None

      Description

      Currently extensions can custom bbcode data to bbcodes array in the function bbcode_init() in includes/message_parser.php using core.modify_bbcode_init event.
      But they can't use their own validation methods like the core does:

      'code'			=> array('bbcode_id' => 8,	'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uise' => "\$this->bbcode_code('\$1', '\$2')")),

      The idea is to declare $phpbb_container as a global in the function parse_bbcode() to allow extensions adding custom validation methods for bbcodes, f.e.

      'code'			=> array('bbcode_id' => 8,	'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uise' => "\$phpbb_container->get('vendor.extension.class')->custom_bbcode_validator('\$1', '\$2')")),

      Also the same possibility would be logical to add to the bbcode second pass procedure (includes/bbcode.php).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                nickvergessen Joas Schilling
                Reporter:
                rxu rxu
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: