You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-08-07 17:42:53 +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:
@@ -25,24 +25,29 @@ abstract class Smarty_Resource
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $sysplugins = array('file' => 'smarty_internal_resource_file.php',
|
||||
'string' => 'smarty_internal_resource_string.php',
|
||||
'extends' => 'smarty_internal_resource_extends.php',
|
||||
'stream' => 'smarty_internal_resource_stream.php',
|
||||
'eval' => 'smarty_internal_resource_eval.php',
|
||||
'php' => 'smarty_internal_resource_php.php');
|
||||
public static $sysplugins = array(
|
||||
'file' => 'smarty_internal_resource_file.php',
|
||||
'string' => 'smarty_internal_resource_string.php',
|
||||
'extends' => 'smarty_internal_resource_extends.php',
|
||||
'stream' => 'smarty_internal_resource_stream.php',
|
||||
'eval' => 'smarty_internal_resource_eval.php',
|
||||
'php' => 'smarty_internal_resource_php.php'
|
||||
);
|
||||
|
||||
/**
|
||||
* Source is bypassing compiler
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $uncompiled = false;
|
||||
|
||||
/**
|
||||
* Source must be recompiled on every occasion
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $recompiled = false;
|
||||
|
||||
/**
|
||||
* Flag if resource does implement populateCompiledFilepath() method
|
||||
*
|
||||
@@ -53,8 +58,8 @@ abstract class Smarty_Resource
|
||||
/**
|
||||
* Load Resource Handler
|
||||
*
|
||||
* @param Smarty $smarty smarty object
|
||||
* @param string $type name of the resource
|
||||
* @param Smarty $smarty smarty object
|
||||
* @param string $type name of the resource
|
||||
*
|
||||
* @throws SmartyException
|
||||
* @return Smarty_Resource Resource Handler
|
||||
@@ -82,9 +87,13 @@ abstract class Smarty_Resource
|
||||
if (class_exists($_resource_class, false)) {
|
||||
return $smarty->_cache[ 'resource_handlers' ][ $type ] = new $_resource_class();
|
||||
} else {
|
||||
$smarty->registerResource($type,
|
||||
array("smarty_resource_{$type}_source", "smarty_resource_{$type}_timestamp",
|
||||
"smarty_resource_{$type}_secure", "smarty_resource_{$type}_trusted"));
|
||||
$smarty->registerResource(
|
||||
$type,
|
||||
array(
|
||||
"smarty_resource_{$type}_source", "smarty_resource_{$type}_timestamp",
|
||||
"smarty_resource_{$type}_secure", "smarty_resource_{$type}_trusted"
|
||||
)
|
||||
);
|
||||
// give it another try, now that the resource is registered properly
|
||||
return self::load($smarty, $type);
|
||||
}
|
||||
@@ -105,10 +114,11 @@ abstract class Smarty_Resource
|
||||
|
||||
/**
|
||||
* extract resource_type and resource_name from template_resource and config_resource
|
||||
*
|
||||
* @note "C:/foo.tpl" was forced to file resource up till Smarty 3.1.3 (including).
|
||||
*
|
||||
* @param string $resource_name template_resource or config_resource to parse
|
||||
* @param string $default_resource the default resource_type defined in $smarty
|
||||
* @param string $resource_name template_resource or config_resource to parse
|
||||
* @param string $default_resource the default resource_type defined in $smarty
|
||||
*
|
||||
* @return array with parsed resource name and type
|
||||
*/
|
||||
@@ -129,8 +139,9 @@ abstract class Smarty_Resource
|
||||
/**
|
||||
* modify template_resource according to resource handlers specifications
|
||||
*
|
||||
* @param \Smarty_Internal_Template|\Smarty $obj Smarty instance
|
||||
* @param string $template_resource template_resource to extract resource handler and name of
|
||||
* @param \Smarty_Internal_Template|\Smarty $obj Smarty instance
|
||||
* @param string $template_resource template_resource to extract resource handler and
|
||||
* name of
|
||||
*
|
||||
* @return string unique resource name
|
||||
* @throws \SmartyException
|
||||
@@ -143,8 +154,8 @@ abstract class Smarty_Resource
|
||||
$resource = Smarty_Resource::load($smarty, $type);
|
||||
// go relative to a given template?
|
||||
$_file_is_dotted = $name[ 0 ] === '.' && ($name[ 1 ] === '.' || $name[ 1 ] === '/');
|
||||
if ($obj->_isTplObj() && $_file_is_dotted &&
|
||||
($obj->source->type === 'file' || $obj->parent->source->type === 'extends')
|
||||
if ($obj->_isTplObj() && $_file_is_dotted
|
||||
&& ($obj->source->type === 'file' || $obj->parent->source->type === 'extends')
|
||||
) {
|
||||
$name = $smarty->_realpath(dirname($obj->parent->source->filepath) . DIRECTORY_SEPARATOR . $name);
|
||||
}
|
||||
@@ -156,24 +167,25 @@ abstract class Smarty_Resource
|
||||
* wrapper for backward compatibility to versions < 3.1.22
|
||||
* Either [$_template] or [$smarty, $template_resource] must be specified
|
||||
*
|
||||
* @param Smarty_Internal_Template $_template template object
|
||||
* @param Smarty $smarty smarty object
|
||||
* @param string $template_resource resource identifier
|
||||
* @param Smarty_Internal_Template $_template template object
|
||||
* @param Smarty $smarty smarty object
|
||||
* @param string $template_resource resource identifier
|
||||
*
|
||||
* @return \Smarty_Template_Source Source Object
|
||||
* @throws \SmartyException
|
||||
*/
|
||||
public static function source(Smarty_Internal_Template $_template = null,
|
||||
Smarty $smarty = null,
|
||||
$template_resource = null)
|
||||
{
|
||||
public static function source(
|
||||
Smarty_Internal_Template $_template = null,
|
||||
Smarty $smarty = null,
|
||||
$template_resource = null
|
||||
) {
|
||||
return Smarty_Template_Source::load($_template, $smarty, $template_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
|
||||
@@ -201,9 +213,9 @@ abstract class Smarty_Resource
|
||||
/**
|
||||
* 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
|
||||
* @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
|
||||
*/
|
||||
@@ -228,11 +240,10 @@ abstract class Smarty_Resource
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
|
||||
/**
|
||||
* Determine basename for compiled filename
|
||||
*
|
||||
* @param Smarty_Template_Source $source source object
|
||||
* @param Smarty_Template_Source $source source object
|
||||
*
|
||||
* @return string resource's basename
|
||||
*/
|
||||
@@ -249,4 +260,3 @@ abstract class Smarty_Resource
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user