mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/controller] Don't attempt to assign if no variable is give
PHPBB3-10864
This commit is contained in:
parent
b5255d4ea4
commit
ef46af8298
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue