[feature/template-events] Always commit suicide for invalid event names.

Note: suicide happens for syntactically invalid event names,
e.g. event names containing punctuation.

Event names for which there are no events are silently dropped.

PHPBB3-9550
This commit is contained in:
Oleg Pudeyev 2012-05-10 03:53:30 -04:00
parent f46f48a2cf
commit 45a1219886

View file

@ -878,15 +878,8 @@ class phpbb_template_filter extends php_user_filter
if (!preg_match('/^\w+$/', $tag_args)) if (!preg_match('/^\w+$/', $tag_args))
{ {
// The hook location is wrongly formatted, // The hook location is wrongly formatted,
// if the `DEBUG` constant is set then trigger a warning, global $user;
// otherwise drop the hook and continue trigger_error($user->lang('ERR_TEMPLATE_EVENT_LOCATION', $tag_args), E_USER_ERROR);
if (defined('DEBUG'))
{
global $user;
trigger_error($user->lang('ERR_TEMPLATE_EVENT_LOCATION', $tag_args), E_USER_NOTICE);
}
return;
} }
$location = $tag_args; $location = $tag_args;