diff options
| author | David King <imkingdavid@gmail.com> | 2012-11-13 09:57:51 -0500 |
|---|---|---|
| committer | David King <imkingdavid@gmail.com> | 2012-11-16 16:47:29 -0500 |
| commit | ef46af8298e18c64b662375adb7eaa40342900a8 (patch) | |
| tree | 45483e2bc8c7655f7dfbb7019b9221c596cd75e9 /phpBB/includes | |
| parent | b5255d4ea4f9e5e1d8c2783555891a0d5a63aca2 (diff) | |
| download | forums-ef46af8298e18c64b662375adb7eaa40342900a8.tar forums-ef46af8298e18c64b662375adb7eaa40342900a8.tar.gz forums-ef46af8298e18c64b662375adb7eaa40342900a8.tar.bz2 forums-ef46af8298e18c64b662375adb7eaa40342900a8.tar.xz forums-ef46af8298e18c64b662375adb7eaa40342900a8.zip | |
[feature/controller] Don't attempt to assign if no variable is give
PHPBB3-10864
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/template/template.php | 7 |
1 files 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 |
