1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-13 20:32:11 +02:00

[ticket/15904] Fix counting empty template blocks

PHPBB3-15904
This commit is contained in:
kasimi 2018-12-08 22:06:19 +01:00
parent 73fd2f3573
commit 3bce8bce10
No known key found for this signature in database
GPG Key ID: 3163AB573241193A

View File

@ -201,7 +201,8 @@ class context
$pos = strpos($blocks[$i], '[');
$name = ($pos !== false) ? substr($blocks[$i], 0, $pos) : $blocks[$i];
$block = &$block[$name];
$index = (!$pos || strpos($blocks[$i], '[]') === $pos) ? (count($block) - 1) : (min((int) substr($blocks[$i], $pos + 1, -1), count($block) - 1));
$block_count = empty($block) ? 0 : count($block) - 1;
$index = (!$pos || strpos($blocks[$i], '[]') === $pos) ? $block_count : (min((int) substr($blocks[$i], $pos + 1, -1), $block_count));
$block = &$block[$index];
}