diff options
Diffstat (limited to 'phpBB/phpbb/template')
| -rw-r--r-- | phpBB/phpbb/template/context.php | 10 | ||||
| -rw-r--r-- | phpBB/phpbb/template/twig/extension.php | 2 | 
2 files changed, 11 insertions, 1 deletions
| diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php index de583d3224..2ba6d185ad 100644 --- a/phpBB/phpbb/template/context.php +++ b/phpBB/phpbb/template/context.php @@ -274,6 +274,11 @@ class context  			{  				$name = substr($blocks[$i], 0, $pos); +				if (empty($block[$name])) +				{ +					return array(); +				} +  				if (strpos($blocks[$i], '[]') === $pos)  				{  					$index = count($block[$name]) - 1; @@ -286,6 +291,11 @@ class context  			else  			{  				$name = $blocks[$i]; +				if (empty($block[$name])) +				{ +					return array(); +				} +  				$index = count($block[$name]) - 1;  			}  			$block = $block[$name]; diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php index 1aa7717470..f6f8e03ca2 100644 --- a/phpBB/phpbb/template/twig/extension.php +++ b/phpBB/phpbb/template/twig/extension.php @@ -172,7 +172,7 @@ class extension extends \Twig_Extension  		$context_vars = $this->context->get_root_ref(); -		if (isset($context_vars['L_' . $key])) +		if (is_string($key) && isset($context_vars['L_' . $key]))  		{  			return $context_vars['L_' . $key];  		} | 
