diff options
author | JoshyPHP <s9e.dev@gmail.com> | 2019-12-13 01:46:09 +0100 |
---|---|---|
committer | JoshyPHP <s9e.dev@gmail.com> | 2019-12-13 01:46:09 +0100 |
commit | 2926ceba6a06a2f0f95452ae838a89247c493c93 (patch) | |
tree | c37fb3d6bc24a678fe788cfc6fc2b87eb23b1dcd /phpBB/phpbb/textformatter/acp_utils_interface.php | |
parent | 5be4cca4083e3f2611f7725058afa127ef701ef1 (diff) | |
download | forums-2926ceba6a06a2f0f95452ae838a89247c493c93.tar forums-2926ceba6a06a2f0f95452ae838a89247c493c93.tar.gz forums-2926ceba6a06a2f0f95452ae838a89247c493c93.tar.bz2 forums-2926ceba6a06a2f0f95452ae838a89247c493c93.tar.xz forums-2926ceba6a06a2f0f95452ae838a89247c493c93.zip |
[ticket/16250] Add a service to check BBCodes safeness
PHPBB3-16250
Diffstat (limited to 'phpBB/phpbb/textformatter/acp_utils_interface.php')
-rw-r--r-- | phpBB/phpbb/textformatter/acp_utils_interface.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/phpBB/phpbb/textformatter/acp_utils_interface.php b/phpBB/phpbb/textformatter/acp_utils_interface.php new file mode 100644 index 0000000000..d1e3de9989 --- /dev/null +++ b/phpBB/phpbb/textformatter/acp_utils_interface.php @@ -0,0 +1,38 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\textformatter; + +interface acp_utils_interface +{ + /** + * Analyse given BBCode definition for issues and safeness + * + * Required elements in the return array: + * - status: + * - "safe" The BBCode is valid and can be safely used by anyone. + * - "unsafe" The BBCode is valid but may be unsafe to use. + * - "invalid_definition" There is an issue with the definition. + * - "invalid_template" There is an issue with the template. + * + * Optional elements in the return array: + * - name: Name of the BBCode based on the definition. Required if status is "safe". + * - error_text: Textual description of the issue in plain text or as a L_* string. + * - error_html: Visual description of the issue in HTML. + * + * @param string $definition BBCode definition, e.g. [b]{TEXT}[/b] + * @param string $template BBCode template, e.g. <b>{TEXT}</b> + * @return array + */ + public function analyse_bbcode(string $definition, string $template): array; +} |