Merge pull request #6831 from rxu/ticket/17527

[ticket/17527] Add Twig extensions existence check while registering
This commit is contained in:
Marc Alexander 2025-06-17 11:30:52 +02:00 committed by GitHub
commit 9219c03b36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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/'))