From ef46af8298e18c64b662375adb7eaa40342900a8 Mon Sep 17 00:00:00 2001 From: David King Date: Tue, 13 Nov 2012 09:57:51 -0500 Subject: [PATCH] [feature/controller] Don't attempt to assign if no variable is give PHPBB3-10864 --- phpBB/includes/template/template.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php index 75bbbe2ef3..11d226d705 100644 --- a/phpBB/includes/template/template.php +++ b/phpBB/includes/template/template.php @@ -227,12 +227,15 @@ class phpbb_template { $contents = $this->return_display($handle); - if (!$template_var) + if (!$template_var && !$return_contents) { throw new RuntimeException($this->user->lang('TEMPLATE_CANNOT_BE_ASSIGNED')); } - $this->assign_var($template_var, $contents); + if ($template_var) + { + $this->assign_var($template_var, $contents); + } // If !$return_content evaluates to true, true will be returned // Otherwise, the value of $contents will be returned