mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 14:30:32 +02:00
[feature/controller] Don't allow a kernel listener to be added with no method
PHPBB3-10864
This commit is contained in:
@@ -44,10 +44,7 @@ class phpbb_event_kernel_compiler_pass implements CompilerPassInterface
|
||||
|
||||
if (!isset($event['method']))
|
||||
{
|
||||
$event['method'] = 'on'.preg_replace(array(
|
||||
'/(?<=\b)[a-z]/ie',
|
||||
'/[^a-z0-9]/i'
|
||||
), array('strtoupper("\\0")', ''), $event['event']);
|
||||
throw new InvalidArgumentException($user->lang('NO_METHOD_ATTRIBUTE', $id));
|
||||
}
|
||||
|
||||
$definition->addMethodCall('addListenerService', array($event['event'], array($id, $event['method']), $priority));
|
||||
|
Reference in New Issue
Block a user