1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-04 13:35:13 +02:00

[feature/controller] Don't attempt to assign if no variable is give

PHPBB3-10864
This commit is contained in:
David King 2012-11-13 09:57:51 -05:00
parent b5255d4ea4
commit ef46af8298

View File

@ -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