- bugfix of unneeded instanceof conditions replacement

This commit is contained in:
uwetews
2015-08-23 05:33:04 +02:00
parent 189b2af115
commit 3daf187fb1
4 changed files with 4 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ class Smarty_Internal_Method_MustCompile
public function mustCompile(Smarty_Internal_Template $_template)
{
if (!$_template->source->exists) {
if ($_template->parent->_objType == 2) {
if (isset($_template->parent) && $_template->parent->_objType == 2) {
$parent_resource = " in '$_template->parent->template_resource}'";
} else {
$parent_resource = '';

View File

@@ -42,7 +42,7 @@ class Smarty_Internal_Nocache_Insert
$_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl);?>";
}
$_tpl = $_template;
while ($_tpl->parent->_objType == 2) {
while (isset($_tpl->parent) && $_tpl->parent->_objType == 2) {
$_tpl = $_tpl->parent;
}

View File

@@ -35,7 +35,7 @@ class Smarty_Internal_Resource_File extends Smarty_Resource
return is_file($file) ? $file : false;
}
// go relative to a given template?
if ($file[0] == '.' && $_template && $_template->parent->_objType == 2 &&
if ($file[0] == '.' && $_template && isset($_template->parent) && $_template->parent->_objType == 2 &&
preg_match('#^[.]{1,2}[\\\/]#', $file)
) {
if ($_template->parent->source->type != 'file' && $_template->parent->source->type != 'extends' &&

View File

@@ -72,7 +72,7 @@ class Smarty_Internal_Resource_Php extends Smarty_Internal_Resource_File
throw new SmartyException("PHP templates are disabled");
}
if (!$source->exists) {
if ($_template->parent->_objType == 2) {
if (isset($_template->parent) && $_template->parent->_objType == 2) {
$parent_resource = " in '{$_template->parent->template_resource}'";
} else {
$parent_resource = '';