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:
@@ -24,10 +24,10 @@ class Smarty_Internal_Method_ClearCompiledTemplate
|
||||
* @api Smarty::clearCompiledTemplate()
|
||||
* @link http://www.smarty.net/docs/en/api.clear.compiled.template.tpl
|
||||
*
|
||||
* @param \Smarty $smarty
|
||||
* @param string $resource_name template name
|
||||
* @param string $compile_id compile id
|
||||
* @param integer $exp_time expiration time
|
||||
* @param \Smarty $smarty
|
||||
* @param string $resource_name template name
|
||||
* @param string $compile_id compile id
|
||||
* @param integer $exp_time expiration time
|
||||
*
|
||||
* @return int number of template files deleted
|
||||
* @throws \SmartyException
|
||||
@@ -69,8 +69,7 @@ class Smarty_Internal_Method_ClearCompiledTemplate
|
||||
try {
|
||||
$_compileDirs = new RecursiveDirectoryIterator($_dir);
|
||||
// NOTE: UnexpectedValueException thrown for PHP >= 5.3
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
return 0;
|
||||
}
|
||||
$_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST);
|
||||
@@ -90,18 +89,22 @@ class Smarty_Internal_Method_ClearCompiledTemplate
|
||||
continue;
|
||||
}
|
||||
$unlink = false;
|
||||
if ((!isset($_compile_id) || (isset($_filepath[ $_compile_id_part_length ]) && $a =
|
||||
!strncmp($_filepath, $_compile_id_part, $_compile_id_part_length))) &&
|
||||
(!isset($resource_name) || (isset($_filepath[ $_resource_part_1_length ]) &&
|
||||
substr_compare($_filepath,
|
||||
$_resource_part_1,
|
||||
-$_resource_part_1_length,
|
||||
$_resource_part_1_length) ===
|
||||
0) || (isset($_filepath[ $_resource_part_2_length ]) &&
|
||||
substr_compare($_filepath,
|
||||
$_resource_part_2,
|
||||
-$_resource_part_2_length,
|
||||
$_resource_part_2_length) === 0))
|
||||
if ((!isset($_compile_id) ||
|
||||
(isset($_filepath[ $_compile_id_part_length ]) &&
|
||||
$a = !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length)))
|
||||
&& (!isset($resource_name) || (isset($_filepath[ $_resource_part_1_length ])
|
||||
&& substr_compare(
|
||||
$_filepath,
|
||||
$_resource_part_1,
|
||||
-$_resource_part_1_length,
|
||||
$_resource_part_1_length
|
||||
) === 0) || (isset($_filepath[ $_resource_part_2_length ])
|
||||
&& substr_compare(
|
||||
$_filepath,
|
||||
$_resource_part_2,
|
||||
-$_resource_part_2_length,
|
||||
$_resource_part_2_length
|
||||
) === 0))
|
||||
) {
|
||||
if (isset($exp_time)) {
|
||||
if (is_file($_filepath) && time() - filemtime($_filepath) >= $exp_time) {
|
||||
@@ -117,7 +120,7 @@ class Smarty_Internal_Method_ClearCompiledTemplate
|
||||
&& (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api')) < 1)
|
||||
) {
|
||||
opcache_invalidate($_filepath, true);
|
||||
} else if (function_exists('apc_delete_file')) {
|
||||
} elseif (function_exists('apc_delete_file')) {
|
||||
apc_delete_file($_filepath);
|
||||
}
|
||||
}
|
||||
@@ -125,4 +128,4 @@ class Smarty_Internal_Method_ClearCompiledTemplate
|
||||
}
|
||||
return $_count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user