diff --git a/change_log.txt b/change_log.txt index a1d38610..58521758 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,7 @@ ===== trunk ===== 28.10.2013 - bugfix variable resource name at custom resource plugin did not work within {block} tags (Issue 163) + - bugfix notice "Trying to get property of non-object" removed (Issue 163) 20.10.2013 - bugfix a variable file name at {extends} tag did fail (forum topic 24618) diff --git a/libs/sysplugins/smarty_resource.php b/libs/sysplugins/smarty_resource.php index 4c9e1595..703d6145 100644 --- a/libs/sysplugins/smarty_resource.php +++ b/libs/sysplugins/smarty_resource.php @@ -529,8 +529,8 @@ abstract class Smarty_Resource self::parseResourceName($template_resource, $smarty->default_resource_type, $name, $type); $resource = Smarty_Resource::load($smarty, $type); // go relative to a given template? - $_file_is_dotted = $name[0] == '.' && ($name[1] == '.' || $name[1] == '/' || $name[1] == "\\"); - if ($_template->parent instanceof Smarty_Internal_Template && $_file_is_dotted && ($_template->parent->source->type == 'file' || $_template->parent->source->type == 'extends')) { + $_file_is_dotted = isset($name[0]) && $name[0] == '.' && ($name[1] == '.' || $name[1] == '/' || $name[1] == "\\"); + if ($_file_is_dotted && isset($_template) && $_template->parent instanceof Smarty_Internal_Template && ($_template->parent->source->type == 'file' || $_template->parent->source->type == 'extends')) { $name2 = dirname($_template->parent->source->filepath) . DS . $name; } else { $name2 = $name;