From 136c74bd1c3d2ef1f22055d9bb14e6f524d41433 Mon Sep 17 00:00:00 2001 From: javiexin Date: Thu, 12 Jan 2017 21:28:58 +0100 Subject: [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 --- phpBB/phpbb/template/context.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/template/context.php') 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; } -- cgit v1.2.1