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

Allow extensions using custom bbcode validation methods

    XMLWordPrintable

Details

    • Improvement
    • Status: Unverified Fix (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.1.3, 3.2.0-dev
    • 3.1.5-RC1
    • Events, Extensions
    • 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

              nickvergessen Joas Schilling [X] (Inactive)
              rxu rxu [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: