[ticket/15214] Move $ext_namespace str_replace to work

Added this when I initially tested the if block move.
but I forgot to add it in the actual commit.
If this isn't moved, no template events work, and the tests fail.

PHPBB3-15214
This commit is contained in:
toxyy 2023-12-09 14:50:13 -05:00
parent 648cd688ca
commit 3714202dd9

View file

@ -51,9 +51,9 @@ class event extends \Twig\Node\Node
// Group and sort extension template events in according to their priority (0 by default if not set)
foreach ($this->environment->get_phpbb_extensions() as $ext_namespace => $ext_path)
{
$ext_namespace = str_replace('/', '_', $ext_namespace);
if ($this->environment->isDebug() || $this->environment->getLoader()->exists('@' . $ext_namespace . '/' . $location . '.html'))
{
$ext_namespace = str_replace('/', '_', $ext_namespace);
$priority_key = $this->template_event_priority_array[$ext_namespace][$location] ?? 0;
$template_events[$priority_key][] = $ext_namespace;
}