mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/14943] Fix template loop access by index
Allows inserting elements in a loop specified as 'outer[3].inner'. This was coded, but malfunctioning. Name incorrectly set on insert. PHPBB3-14943
This commit is contained in:
parent
d9991bdaf1
commit
45ea013b11
1 changed files with 3 additions and 1 deletions
|
@ -325,11 +325,13 @@ class context
|
||||||
}
|
}
|
||||||
|
|
||||||
$block = &$block[$blocks[$i]]; // Traverse the last block
|
$block = &$block[$blocks[$i]]; // Traverse the last block
|
||||||
|
$name = $blocks[$i];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Top-level block.
|
// Top-level block.
|
||||||
$block = &$this->tpldata[$blockname];
|
$block = &$this->tpldata[$blockname];
|
||||||
|
$name = $blockname;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change key to zero (change first position) if false and to last position if true
|
// Change key to zero (change first position) if false and to last position if true
|
||||||
|
@ -378,7 +380,7 @@ class context
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assign S_BLOCK_NAME
|
// Assign S_BLOCK_NAME
|
||||||
$vararray['S_BLOCK_NAME'] = $blockname;
|
$vararray['S_BLOCK_NAME'] = $name;
|
||||||
|
|
||||||
// Re-position template blocks
|
// Re-position template blocks
|
||||||
for ($i = sizeof($block); $i > $key; $i--)
|
for ($i = sizeof($block); $i > $key; $i--)
|
||||||
|
|
Loading…
Add table
Reference in a new issue