diff --git a/phpBB/includes/controller/resolver.php b/phpBB/includes/controller/resolver.php index e44aa14b55..95dfc8da8e 100644 --- a/phpBB/includes/controller/resolver.php +++ b/phpBB/includes/controller/resolver.php @@ -50,7 +50,7 @@ class phpbb_controller_resolver implements ControllerResolverInterface * @param ContainerInterface $container ContainerInterface object * @param phpbb_style $style */ - public function __construct(phpbb_user $user, ContainerInterface $container, phpbb_style $style) + public function __construct(phpbb_user $user, ContainerInterface $container, phpbb_style $style = null) { $this->user = $user; $this->container = $container; @@ -96,7 +96,7 @@ class phpbb_controller_resolver implements ControllerResolverInterface $controller_dir = explode('_', get_class($controller_object)); // 0 phpbb, 1 ext, 2 vendor, 3 extension name, ... - if (isset($controller_dir[3]) && $controller_dir[1] === 'ext') + if (!is_null($this->style) && isset($controller_dir[3]) && $controller_dir[1] === 'ext') { $controller_style_dir = 'ext/' . $controller_dir[2] . '/' . $controller_dir[3] . '/styles';