[ticket/17527] Add Twig extensions existence check while registering

PHPBB-17527
This commit is contained in:
rxu 2025-06-16 22:25:59 +07:00
parent 2f43c1facd
commit 579b4a8287
No known key found for this signature in database
GPG key ID: 955F0567380E586A

View file

@ -98,9 +98,12 @@ class twig extends \phpbb\template\base
$this->twig = $twig_environment;
foreach ($extensions as $extension)
{
if (!$this->twig->hasExtension(get_class($extension)))
{
$this->twig->addExtension($extension);
}
}
// Add admin namespace
if ($this->path_helper->get_adm_relative_path() !== null && is_dir($this->phpbb_root_path . $this->path_helper->get_adm_relative_path() . 'style/'))