1
0
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:
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

@@ -1,4 +1,5 @@
<?php
/**
* Smarty Method CompileAllTemplates
*
@@ -20,22 +21,23 @@ class Smarty_Internal_Method_CompileAllTemplates
/**
* Compile all template files
*
* @api Smarty::compileAllTemplates()
* @api Smarty::compileAllTemplates()
*
* @param \Smarty $smarty passed smarty object
* @param string $extension file extension
* @param bool $force_compile force all to recompile
* @param int $time_limit
* @param int $max_errors
* @param string $extension file extension
* @param bool $force_compile force all to recompile
* @param int $time_limit
* @param int $max_errors
*
* @return integer number of template files recompiled
*/
public function compileAllTemplates(Smarty $smarty,
$extension = '.tpl',
$force_compile = false,
$time_limit = 0,
$max_errors = null)
{
public function compileAllTemplates(
Smarty $smarty,
$extension = '.tpl',
$force_compile = false,
$time_limit = 0,
$max_errors = null
) {
return $this->compileAll($smarty, $extension, $force_compile, $time_limit, $max_errors);
}
@@ -43,21 +45,22 @@ class Smarty_Internal_Method_CompileAllTemplates
* Compile all template or config files
*
* @param \Smarty $smarty
* @param string $extension template file name extension
* @param bool $force_compile force all to recompile
* @param int $time_limit set maximum execution time
* @param int $max_errors set maximum allowed errors
* @param string $extension template file name extension
* @param bool $force_compile force all to recompile
* @param int $time_limit set maximum execution time
* @param int $max_errors set maximum allowed errors
* @param bool $isConfig flag true if called for config files
*
* @return int number of template files compiled
*/
protected function compileAll(Smarty $smarty,
$extension,
$force_compile,
$time_limit,
$max_errors,
$isConfig = false)
{
protected function compileAll(
Smarty $smarty,
$extension,
$force_compile,
$time_limit,
$max_errors,
$isConfig = false
) {
// switch off time limit
if (function_exists('set_time_limit')) {
@set_time_limit($time_limit);
@@ -67,15 +70,18 @@ class Smarty_Internal_Method_CompileAllTemplates
$sourceDir = $isConfig ? $smarty->getConfigDir() : $smarty->getTemplateDir();
// loop over array of source directories
foreach ($sourceDir as $_dir) {
$_dir_1 = new RecursiveDirectoryIterator($_dir, defined('FilesystemIterator::FOLLOW_SYMLINKS') ?
FilesystemIterator::FOLLOW_SYMLINKS : 0);
$_dir_1 = new RecursiveDirectoryIterator(
$_dir,
defined('FilesystemIterator::FOLLOW_SYMLINKS') ?
FilesystemIterator::FOLLOW_SYMLINKS : 0
);
$_dir_2 = new RecursiveIteratorIterator($_dir_1);
foreach ($_dir_2 as $_fileinfo) {
$_file = $_fileinfo->getFilename();
if (substr(basename($_fileinfo->getPathname()), 0, 1) === '.' || strpos($_file, '.svn') !== false) {
continue;
}
if (!substr_compare($_file, $extension, -strlen($extension)) === 0) {
if (substr_compare($_file, $extension, -strlen($extension)) !== 0) {
continue;
}
if ($_fileinfo->getPath() !== substr($_dir, 0, -1)) {
@@ -105,8 +111,7 @@ class Smarty_Internal_Method_CompileAllTemplates
echo ' is up to date';
flush();
}
}
catch (Exception $e) {
} catch (Exception $e) {
echo "\n<br> ------>Error: ", $e->getMessage(), "<br><br>\n";
$_error_count++;
}
@@ -122,4 +127,4 @@ class Smarty_Internal_Method_CompileAllTemplates
echo "\n<br>";
return $_count;
}
}
}