aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/template
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 /phpBB/includes/template
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
Diffstat (limited to 'phpBB/includes/template')
-rw-r--r--phpBB/includes/template/filter.php12
1 files changed, 10 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;