aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template/context.php
diff options
context:
space:
mode:
authorjaviexin <javiexin@gmail.com>2017-01-12 21:28:58 +0100
committerjaviexin <javiexin@gmail.com>2017-01-12 21:28:58 +0100
commit136c74bd1c3d2ef1f22055d9bb14e6f524d41433 (patch)
treeb7dbe903b6e0645e8a0889aa7b44d13a180df051 /phpBB/phpbb/template/context.php
parent988865fd0a1d213a441777b3c613265365fe651a (diff)
downloadforums-136c74bd1c3d2ef1f22055d9bb14e6f524d41433.tar
forums-136c74bd1c3d2ef1f22055d9bb14e6f524d41433.tar.gz
forums-136c74bd1c3d2ef1f22055d9bb14e6f524d41433.tar.bz2
forums-136c74bd1c3d2ef1f22055d9bb14e6f524d41433.tar.xz
forums-136c74bd1c3d2ef1f22055d9bb14e6f524d41433.zip
[ticket/14950] Add possibility to delete a template block
Adds a new mode to alter_block_array to allow for the deletion of a certain block of template variables. The selection method is the same as for the other modes for alter_block_array. The passed in vararray is ignored, and an out of bounds index is considered an error. Added tests for the new function, fixed. PHPBB3-14950
Diffstat (limited to 'phpBB/phpbb/template/context.php')
-rw-r--r--phpBB/phpbb/template/context.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php
index ce0fef37fc..b909b248aa 100644
--- a/phpBB/phpbb/template/context.php
+++ b/phpBB/phpbb/template/context.php
@@ -413,7 +413,7 @@ class context
if ($mode == 'delete')
{
// If we are exceeding last iteration, do not delete anything
- if ($key > sizeof($block))
+ if ($key > sizeof($block) || $key < 0)
{
return false;
}