From 97bbf2d2b8b5b7689432ad8a35e96c38fd869dd7 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 7 Feb 2016 14:35:42 +0100 Subject: [PATCH] [ticket/14457] Handle the case where there isn't any 'definition' bag PHPBB3-14457 --- phpBB/phpbb/template/twig/environment.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php index 65f1af5d9e..56c85c8d71 100644 --- a/phpBB/phpbb/template/twig/environment.php +++ b/phpBB/phpbb/template/twig/environment.php @@ -213,8 +213,11 @@ class environment extends \Twig_Environment { $placeholder_salt = unique_id(); - $context['definition']->set('SCRIPTS', '__SCRIPTS_' . $placeholder_salt . '__'); - $context['definition']->set('STYLESHEETS', '__STYLESHEETS_' . $placeholder_salt . '__'); + if (array_key_exists('definition', $context)) + { + $context['definition']->set('SCRIPTS', '__SCRIPTS_' . $placeholder_salt . '__'); + $context['definition']->set('STYLESHEETS', '__STYLESHEETS_' . $placeholder_salt . '__'); + } $output = parent::render($name, $context);