mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-07 01:06:48 +02:00
[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
This commit is contained in:
committed by
Oleg Pudeyev
parent
db688c2574
commit
132bbede2b
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user