aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template
diff options
context:
space:
mode:
authorjaviexin <javiexin@gmail.com>2017-01-01 21:22:29 +0100
committerjaviexin <javiexin@gmail.com>2017-01-01 21:22:29 +0100
commit45ea013b111547ef684cc7c64dd91a6217935ab1 (patch)
tree91a0cc75e9ebe79a584a5fda12d5bd8e789a57f4 /phpBB/phpbb/template
parentd9991bdaf1aa9685437c4f4c298fa54f0c0f33f0 (diff)
downloadforums-45ea013b111547ef684cc7c64dd91a6217935ab1.tar
forums-45ea013b111547ef684cc7c64dd91a6217935ab1.tar.gz
forums-45ea013b111547ef684cc7c64dd91a6217935ab1.tar.bz2
forums-45ea013b111547ef684cc7c64dd91a6217935ab1.tar.xz
forums-45ea013b111547ef684cc7c64dd91a6217935ab1.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. Name incorrectly set on insert. PHPBB3-14943
Diffstat (limited to 'phpBB/phpbb/template')
-rw-r--r--phpBB/phpbb/template/context.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php
index 8bf6c10e2d..f0bc4c859a 100644
--- a/phpBB/phpbb/template/context.php
+++ b/phpBB/phpbb/template/context.php
@@ -325,11 +325,13 @@ class context
}
$block = &$block[$blocks[$i]]; // Traverse the last block
+ $name = $blocks[$i];
}
else
{
// Top-level block.
$block = &$this->tpldata[$blockname];
+ $name = $blockname;
}
// 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
- $vararray['S_BLOCK_NAME'] = $blockname;
+ $vararray['S_BLOCK_NAME'] = $name;
// Re-position template blocks
for ($i = sizeof($block); $i > $key; $i--)