1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-08-09 05:02:44 +03:00

update Smarty to v3.1.33 - "This release does cover security issue CVE-2018-16831, other bug fixes (see changelog.txt) and adds a new feature of the {capture} tag (see NEW_FEATURES.txt)."

This commit is contained in:
David Goodwin
2019-09-25 13:55:07 +01:00
parent 7360407b73
commit 907bd7ee46
199 changed files with 5335 additions and 4857 deletions

View File

@@ -30,7 +30,7 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource
* {@internal implementing this method is optional.
* Only implement it if modification times can be accessed faster than loading the complete template source.}}
*
* @param string $name template name
* @param string $name template name
*
* @return integer|boolean timestamp (epoch) the template was modified, or false if not found
*/
@@ -47,9 +47,8 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource
*/
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
{
$source->filepath = $source->type . ':' . substr(preg_replace('/[^A-Za-z0-9.]/','',$source->name),0,25);
$source->filepath = $source->type . ':' . substr(preg_replace('/[^A-Za-z0-9.]/', '', $source->name), 0, 25);
$source->uid = sha1($source->type . ':' . $source->name);
$mtime = $this->fetchTimestamp($source->name);
if ($mtime !== null) {
$source->timestamp = $mtime;
@@ -66,7 +65,7 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource
/**
* Load template's source into current template object
*
* @param Smarty_Template_Source $source source object
* @param Smarty_Template_Source $source source object
*
* @return string template source
* @throws SmartyException if source cannot be loaded
@@ -77,19 +76,18 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource
if (isset($content)) {
return $content;
}
throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
}
/**
* Determine basename for compiled filename
*
* @param Smarty_Template_Source $source source object
* @param Smarty_Template_Source $source source object
*
* @return string resource's basename
*/
public function getBasename(Smarty_Template_Source $source)
{
return basename(substr(preg_replace('/[^A-Za-z0-9.]/','',$source->name),0,25));
return basename(substr(preg_replace('/[^A-Za-z0-9.]/', '', $source->name), 0, 25));
}
}