From fa10e0945ecd45bfe78a2c8fb015a43092b4944b Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 10 Dec 2015 14:02:22 +0100 Subject: bug #385 update to smarty-3.1.28-dev (from Github) --- .../sysplugins/smarty_internal_resource_stream.php | 83 +++++++++++----------- 1 file changed, 43 insertions(+), 40 deletions(-) (limited to 'include/smarty/libs/sysplugins/smarty_internal_resource_stream.php') diff --git a/include/smarty/libs/sysplugins/smarty_internal_resource_stream.php b/include/smarty/libs/sysplugins/smarty_internal_resource_stream.php index 58086c179..8a902268c 100644 --- a/include/smarty/libs/sysplugins/smarty_internal_resource_stream.php +++ b/include/smarty/libs/sysplugins/smarty_internal_resource_stream.php @@ -1,36 +1,35 @@ resource, '://') !== false) { + if (strpos($source->resource, '://') !== false) { $source->filepath = $source->resource; } else { $source->filepath = str_replace(':', '://', $source->resource); @@ -42,12 +41,13 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled { } /** - * Load template's source from stream into current template object - * - * @param Smarty_Template_Source $source source object - * @return string template source - * @throws SmartyException if source cannot be loaded - */ + * Load template's source from stream into current template object + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + * @throws SmartyException if source cannot be loaded + */ public function getContent(Smarty_Template_Source $source) { $t = ''; @@ -58,6 +58,7 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled { $t .= $current_line; } fclose($fp); + return $t; } else { return false; @@ -65,13 +66,15 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled { } /** - * modify resource_name according to resource handlers specifications - * - * @param Smarty $smarty Smarty instance - * @param string $resource_name resource_name to make unique - * @return string unique resource name - */ - protected function buildUniqueResourceName(Smarty $smarty, $resource_name) + * modify resource_name according to resource handlers specifications + * + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $isConfig flag for config resource + * + * @return string unique resource name + */ + public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false) { return get_class($this) . '#' . $resource_name; } -- cgit v1.2.3