From be212a2a877cf311f41ffe619b72066248fa0123 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Wed, 1 Jul 2015 06:44:28 +0200 Subject: [PATCH] load template source early --- libs/sysplugins/smarty_internal_template.php | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index 11666468..359d5907 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -167,6 +167,18 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase if ($this->smarty->debugging) { Smarty_Internal_Debug::start_template($this, $display); } + // checks if template exists + if (!isset($this->source)) { + $this->loadSource(); + } + if (!$this->source->exists) { + if ($parentIsTpl) { + $parent_resource = " in '{$this->parent->template_resource}'"; + } else { + $parent_resource = ''; + } + throw new SmartyException("Unable to load template {$this->source->type} '{$this->source->name}'{$parent_resource}"); + } $save_tpl_vars = null; $save_config_vars = null; // merge all variable scopes into template @@ -206,18 +218,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase if (!$this->smarty->debugging && $this->smarty->debugging_ctrl == 'URL') { Smarty_Internal_Debug::debugUrl($this); } - if (!isset($this->source)) { - $this->loadSource(); - } - // checks if template exists - if (!$this->source->exists) { - if ($parentIsTpl) { - $parent_resource = " in '{$this->parent->template_resource}'"; - } else { - $parent_resource = ''; - } - throw new SmartyException("Unable to load template {$this->source->type} '{$this->source->name}'{$parent_resource}"); - } // disable caching for evaluated code if ($this->source->recompiled) { $this->caching = false;