aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/bbcode.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-05-28 10:49:45 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-05-28 10:49:45 +0200
commit95b3b4605a073edde70027c4ad4c889cec89c7a8 (patch)
treea647b817a46876469a6de8e38a0187f9e53555bb /phpBB/includes/bbcode.php
parent2ee9baa3d0d8ca1d1b31dbf8aa471d5726aacedc (diff)
parent7580798a5a24599ba7ed8de6d7a4a60875d8e2ec (diff)
downloadforums-95b3b4605a073edde70027c4ad4c889cec89c7a8.tar
forums-95b3b4605a073edde70027c4ad4c889cec89c7a8.tar.gz
forums-95b3b4605a073edde70027c4ad4c889cec89c7a8.tar.bz2
forums-95b3b4605a073edde70027c4ad4c889cec89c7a8.tar.xz
forums-95b3b4605a073edde70027c4ad4c889cec89c7a8.zip
Merge branch '3.1.x'
Diffstat (limited to 'phpBB/includes/bbcode.php')
-rw-r--r--phpBB/includes/bbcode.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 24eaddf067..dcbf33a3c4 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -202,6 +202,8 @@ class bbcode
$db->sql_freeresult($result);
}
+ // To perform custom second pass in extension, use $this->bbcode_second_pass_by_extension()
+ // method which accepts variable number of parameters
foreach ($bbcode_ids as $bbcode_id)
{
switch ($bbcode_id)
@@ -633,4 +635,36 @@ class bbcode
return $code;
}
+
+ /**
+ * Function to perform custom bbcode second pass by extensions
+ * can be used to assign bbcode pattern replacement
+ * Example: '#\[list=([^\[]+):$uid\]#e' => "\$this->bbcode_second_pass_by_extension('\$1')"
+ *
+ * Accepts variable number of parameters
+ *
+ * @return mixed Second pass result
+ */
+ function bbcode_second_pass_by_extension()
+ {
+ global $phpbb_dispatcher;
+
+ $return = false;
+ $params_array = func_get_args();
+
+ /**
+ * Event to perform bbcode second pass with
+ * the custom validating methods provided by extensions
+ *
+ * @event core.bbcode_second_pass_by_extension
+ * @var array params_array Array with the function parameters
+ * @var mixed return Second pass result to return
+ *
+ * @since 3.1.5-RC1
+ */
+ $vars = array('params_array', 'return');
+ extract($phpbb_dispatcher->trigger_event('core.bbcode_second_pass_by_extension', compact($vars)));
+
+ return $return;
+ }
}