diff options
Diffstat (limited to 'library/Smarty/libs/sysplugins/smarty_internal_resource_file.php')
-rw-r--r-- | library/Smarty/libs/sysplugins/smarty_internal_resource_file.php | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_resource_file.php b/library/Smarty/libs/sysplugins/smarty_internal_resource_file.php index 48b391d20..0abdc4495 100644 --- a/library/Smarty/libs/sysplugins/smarty_internal_resource_file.php +++ b/library/Smarty/libs/sysplugins/smarty_internal_resource_file.php @@ -2,29 +2,28 @@ /** * Smarty Internal Plugin Resource File * - * @package Smarty + * @package Smarty * @subpackage TemplateResources - * @author Uwe Tews - * @author Rodney Rehm + * @author Uwe Tews + * @author Rodney Rehm */ /** * Smarty Internal Plugin Resource File - * * Implements the file system as resource for Smarty templates * - * @package Smarty + * @package Smarty * @subpackage TemplateResources */ -class Smarty_Internal_Resource_File extends Smarty_Resource { - +class Smarty_Internal_Resource_File extends Smarty_Resource +{ /** * populate Source Object with meta data from Resource * * @param Smarty_Template_Source $source source object * @param Smarty_Internal_Template $_template template object */ - public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) + public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null) { $source->filepath = $this->buildFilepath($source, $_template); @@ -33,7 +32,7 @@ class Smarty_Internal_Resource_File extends Smarty_Resource { $source->smarty->security_policy->isTrustedResourceDir($source->filepath); } - $source->uid = sha1($source->filepath); + $source->uid = sha1(realpath($source->filepath)); if ($source->smarty->compile_check && !isset($source->timestamp)) { $source->timestamp = @filemtime($source->filepath); $source->exists = !!$source->timestamp; @@ -55,9 +54,10 @@ class Smarty_Internal_Resource_File extends Smarty_Resource { /** * Load template's source from file into current template object * - * @param Smarty_Template_Source $source source object - * @return string template source - * @throws SmartyException if source cannot be loaded + * @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) { @@ -73,8 +73,9 @@ class Smarty_Internal_Resource_File extends Smarty_Resource { /** * Determine basename for compiled filename * - * @param Smarty_Template_Source $source source object - * @return string resource's basename + * @param Smarty_Template_Source $source source object + * + * @return string resource's basename */ public function getBasename(Smarty_Template_Source $source) { @@ -82,9 +83,7 @@ class Smarty_Internal_Resource_File extends Smarty_Resource { if (($_pos = strpos($_file, ']')) !== false) { $_file = substr($_file, $_pos + 1); } + return basename($_file); } - } - -?>
\ No newline at end of file |