aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/textformatter/acp_utils_interface.php
diff options
context:
space:
mode:
authorMaat <maat-pub@mageia.biz>2020-05-09 01:15:08 +0200
committerMaat <maat-pub@mageia.biz>2020-05-09 01:15:08 +0200
commit6985226b17e8a0ef0a720bf1d12fe0c216e13dab (patch)
tree116d2565ac02c40abe0548863c6badf8ec3e1d1e /phpBB/phpbb/textformatter/acp_utils_interface.php
parent8ea437e30605e0f66b5220bf904a61d7c1d11ddd (diff)
parent8d00784dfe2c8bcb10843ff70b4cfa998d703285 (diff)
downloadforums-6985226b17e8a0ef0a720bf1d12fe0c216e13dab.tar
forums-6985226b17e8a0ef0a720bf1d12fe0c216e13dab.tar.gz
forums-6985226b17e8a0ef0a720bf1d12fe0c216e13dab.tar.bz2
forums-6985226b17e8a0ef0a720bf1d12fe0c216e13dab.tar.xz
forums-6985226b17e8a0ef0a720bf1d12fe0c216e13dab.zip
Merge remote-tracking branch 'upstream/prep-release-3.3.0'HEADmaster
Diffstat (limited to 'phpBB/phpbb/textformatter/acp_utils_interface.php')
-rw-r--r--phpBB/phpbb/textformatter/acp_utils_interface.php54
1 files changed, 54 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..cdee56f19d
--- /dev/null
+++ b/phpBB/phpbb/textformatter/acp_utils_interface.php
@@ -0,0 +1,54 @@
+<?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
+{
+ /**
+ * There is an issue with the definition
+ */
+ const BBCODE_STATUS_INVALID_DEFINITION = 'invalid_definition';
+
+ /**
+ * There is an issue with the template
+ */
+ const BBCODE_STATUS_INVALID_TEMPLATE = 'invalid_template';
+
+ /**
+ * The BBCode is valid and can be safely used by anyone
+ */
+ const BBCODE_STATUS_SAFE = 'safe';
+
+ /**
+ * The BBCode is valid but may be unsafe to use
+ */
+ const BBCODE_STATUS_UNSAFE = 'unsafe';
+
+ /**
+ * Analyse given BBCode definition for issues and safeness
+ *
+ * Required elements in the return array:
+ * - status: see BBCODE_STATUS_* constants
+ *
+ * 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;
+}