phpBB

Code Changes

File: phpbb/template/context.php

  Unmodified   Added   Modified   Removed
Line 201Line 201
			$pos = strpos($blocks[$i], '[');
$name = ($pos !== false) ? substr($blocks[$i], 0, $pos) : $blocks[$i];
$block = &$block[$name];

			$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];
}


			$block = &$block[$index];
}


Line 273Line 274
			if (($pos = strpos($blocks[$i], '[')) !== false)
{
$name = substr($blocks[$i], 0, $pos);

			if (($pos = strpos($blocks[$i], '[')) !== false)
{
$name = substr($blocks[$i], 0, $pos);

 

if (empty($block[$name]))
{
return array();
}


if (strpos($blocks[$i], '[]') === $pos)
{


if (strpos($blocks[$i], '[]') === $pos)
{

Line 286Line 292
			else
{
$name = $blocks[$i];

			else
{
$name = $blocks[$i];

 
				if (empty($block[$name]))
{
return array();
}


				$index = count($block[$name]) - 1;
}
$block = $block[$name];

				$index = count($block[$name]) - 1;
}
$block = $block[$name];