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

Allow extensions using custom bbcode validation methods

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.5-RC1
    • 3.1.3, 3.2.0-dev
    • Events, Extensions
    • None

      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).

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

              Created:
              Updated:
              Resolved: