mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-27 04:18:55 +00:00
[ticket/15214] Move setting $priority_key to a more appropriate place
It doesn't need to be set at the top and makes more sense to set it at the bottom where it's used. Also removes a redundant check PHPBB3-15214
This commit is contained in:
parent
8d6d016a5a
commit
31fb27e8d8
1 changed files with 3 additions and 6 deletions
|
@ -52,11 +52,6 @@ class event extends \Twig\Node\Node
|
||||||
{
|
{
|
||||||
$ext_namespace = str_replace('/', '_', $ext_namespace);
|
$ext_namespace = str_replace('/', '_', $ext_namespace);
|
||||||
|
|
||||||
if (isset($this->template_event_priority_array[$ext_namespace][$location]))
|
|
||||||
{
|
|
||||||
$priority_key = $this->template_event_priority_array[$ext_namespace][$location];
|
|
||||||
}
|
|
||||||
|
|
||||||
$compiler_calls = [];
|
$compiler_calls = [];
|
||||||
|
|
||||||
if ($this->environment->isDebug())
|
if ($this->environment->isDebug())
|
||||||
|
@ -99,8 +94,10 @@ class event extends \Twig\Node\Node
|
||||||
|
|
||||||
if (!empty($compiler_calls))
|
if (!empty($compiler_calls))
|
||||||
{
|
{
|
||||||
if (isset($priority_key))
|
if (isset($this->template_event_priority_array[$ext_namespace][$location]))
|
||||||
{
|
{
|
||||||
|
$priority_key = $this->template_event_priority_array[$ext_namespace][$location];
|
||||||
|
|
||||||
if (array_key_exists($priority_key, $compiler_steps))
|
if (array_key_exists($priority_key, $compiler_steps))
|
||||||
{
|
{
|
||||||
array_splice($compiler_steps, $priority_key, 0, [$compiler_calls]);
|
array_splice($compiler_steps, $priority_key, 0, [$compiler_calls]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue