From 0fb537aed25b97227fd6f1f7596ca94ab7b67020 Mon Sep 17 00:00:00 2001 From: rodneyrehm Date: Wed, 16 Nov 2011 08:25:33 +0000 Subject: [PATCH] - bugfix Smarty_Resource::load() did not always return a proper resource handler (Forum Topic 20414) --- change_log.txt | 3 +++ libs/sysplugins/smarty_resource.php | 4 ++++ 2 files changed, 7 insertions(+) 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]; }