mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
- bugfix of unneeded instanceof conditions replacement
This commit is contained in:
@@ -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 = '';
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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' &&
|
||||
|
@@ -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 = '';
|
||||
|
Reference in New Issue
Block a user