aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaviexin <javiexin@gmail.com>2016-12-28 12:37:53 +0100
committerjaviexin <javiexin@gmail.com>2016-12-28 12:37:53 +0100
commitd9991bdaf1aa9685437c4f4c298fa54f0c0f33f0 (patch)
tree48b9d4c646fd70d7b7de52c86790d49071159d36
parent3322117c3863c443ca1b79d25541bde4c662c0ed (diff)
downloadforums-d9991bdaf1aa9685437c4f4c298fa54f0c0f33f0.tar
forums-d9991bdaf1aa9685437c4f4c298fa54f0c0f33f0.tar.gz
forums-d9991bdaf1aa9685437c4f4c298fa54f0c0f33f0.tar.bz2
forums-d9991bdaf1aa9685437c4f4c298fa54f0c0f33f0.tar.xz
forums-d9991bdaf1aa9685437c4f4c298fa54f0c0f33f0.zip
[ticket/14943] Fix template loop access by index
Allows inserting elements in a loop specified as 'outer[3].inner'. This was coded, but malfunctioning. PHPBB3-14943
-rw-r--r--phpBB/phpbb/template/context.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php
index 4ee48205c8..8bf6c10e2d 100644
--- a/phpBB/phpbb/template/context.php
+++ b/phpBB/phpbb/template/context.php
@@ -365,15 +365,15 @@ class context
if ($mode == 'insert')
{
// Make sure we are not exceeding the last iteration
- if ($key >= sizeof($this->tpldata[$blockname]))
+ if ($key >= sizeof($block))
{
- $key = sizeof($this->tpldata[$blockname]);
- unset($this->tpldata[$blockname][($key - 1)]['S_LAST_ROW']);
+ $key = sizeof($block);
+ unset($block[($key - 1)]['S_LAST_ROW']);
$vararray['S_LAST_ROW'] = true;
}
else if ($key === 0)
{
- unset($this->tpldata[$blockname][0]['S_FIRST_ROW']);
+ unset($block[0]['S_FIRST_ROW']);
$vararray['S_FIRST_ROW'] = true;
}