From a30693a5948861cf6e1f330bc54c8c539d60cdcc Mon Sep 17 00:00:00 2001 From: javiexin Date: Wed, 31 May 2017 20:24:55 +0200 Subject: [PATCH] [ticket/14994] Refactor template->assign_block_var Refactor assign_block_var to use the same block selection mechanism as is used in alter_block_array. This allows creating new blocks at any position in the template structure, not only on the last block. Allows selecting a block as outer[2].middle. Added tests. Added PHP 7.2 compatibility. PHPBB3-14994 --- phpBB/phpbb/template/context.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php index 5a15e12582..c1e971c148 100644 --- a/phpBB/phpbb/template/context.php +++ b/phpBB/phpbb/template/context.php @@ -209,7 +209,7 @@ class context $name = $blocks[$i]; // Assign S_ROW_COUNT and S_ROW_NUM - $s_row_count = isset($block[$name]) ? sizeof($block[$name]) : 0; + $s_row_count = isset($block[$name]) ? count($block[$name]) : 0; $vararray['S_ROW_COUNT'] = $vararray['S_ROW_NUM'] = $s_row_count; // Assign S_FIRST_ROW