1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-31 05:53:14 +02:00

[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
This commit is contained in:
javiexin 2017-01-12 21:28:58 +01:00
parent 988865fd0a
commit 136c74bd1c

View File

@ -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;
}