aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Frèrejean <erikfrerejean@phpbb.com>2012-04-18 15:35:09 +0200
committerOleg Pudeyev <oleg@bsdpower.com>2012-11-17 16:39:58 -0500
commit132bbede2b5ca5e1bbb371bdaef0bb3041c67316 (patch)
tree3aa89c1ebe99ae4674718a8dfeef9059a8a87b8a
parentdb688c2574fd536e1c5f19ed8797d762713c7b6b (diff)
downloadforums-132bbede2b5ca5e1bbb371bdaef0bb3041c67316.tar
forums-132bbede2b5ca5e1bbb371bdaef0bb3041c67316.tar.gz
forums-132bbede2b5ca5e1bbb371bdaef0bb3041c67316.tar.bz2
forums-132bbede2b5ca5e1bbb371bdaef0bb3041c67316.tar.xz
forums-132bbede2b5ca5e1bbb371bdaef0bb3041c67316.zip
[feature/template-events] Handle incorrect template event identifiers
If the template event identifier is wrongly formatted phpBB will triggern an `E_USER_NOTICE` if the `DEBUG` constant is set, otherwise the location is ignored. PHPBB3-9550
-rw-r--r--phpBB/includes/template/filter.php12
-rw-r--r--phpBB/language/en/common.php1
2 files changed, 11 insertions, 2 deletions
diff --git a/phpBB/includes/template/filter.php b/phpBB/includes/template/filter.php
index f3e0f6017c..50882b2855 100644
--- a/phpBB/includes/template/filter.php
+++ b/phpBB/includes/template/filter.php
@@ -877,8 +877,16 @@ class phpbb_template_filter extends php_user_filter
{
if (!preg_match('/^\w+$/', $tag_args))
{
- // do something
- var_dump($tag_args);
+ // The hook location is wrongly formatted,
+ // if the `DEBUG` constant is set then trigger a waring,
+ // otherwise drop the hook and continue
+ if (defined('DEBUG'))
+ {
+ global $user;
+ trigger_error($user->lang('ERR_TEMPLATE_EVENT_LOCATION', $tag_args), E_USER_NOTICE);
+ }
+
+ return;
}
$location = $tag_args;
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 7ce3b5d2e6..5fc1b21e4f 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -186,6 +186,7 @@ $lang = array_merge($lang, array(
'ERR_CONNECTING_SERVER' => 'Error connecting to the server.',
'ERR_JAB_AUTH' => 'Could not authorise on Jabber server.',
'ERR_JAB_CONNECT' => 'Could not connect to Jabber server.',
+ 'ERR_TEMPLATE_EVENT_LOCATION' => 'The specified template event location <em>[%s]</em> is wrongly formatted.',
'ERR_UNABLE_TO_LOGIN' => 'The specified username or password is incorrect.',
'ERR_UNWATCHING' => 'An error occured while trying to unsubscribe.',
'ERR_WATCHING' => 'An error occured while trying to subscribe.',