diff --git a/change_log.txt b/change_log.txt index 9ee50502..671ff1e6 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +16.11.2011 +- bugfix Smarty_Resource::load() did not always return a proper resource handler (Forum Topic 20414) + ===== Smarty-3.1.5 ===== 14.11.2011 - bugfix allow space between function name and open bracket (forum topic 20375) diff --git a/libs/sysplugins/smarty_resource.php b/libs/sysplugins/smarty_resource.php index afe702bb..d2703870 100644 --- a/libs/sysplugins/smarty_resource.php +++ b/libs/sysplugins/smarty_resource.php @@ -349,10 +349,14 @@ abstract class Smarty_Resource { // note registered to smarty is not kept unique! return $smarty->_resource_handlers[$type]; } + if (!isset(self::$resources['registered'])) { self::$resources['registered'] = new Smarty_Internal_Resource_Registered(); + } + if (!isset($smarty->_resource_handlers[$type])) { $smarty->_resource_handlers[$type] = self::$resources['registered']; } + return $smarty->_resource_handlers[$type]; }