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

bump smarty to v4.1.1, some security fixes that probably do not affect PFA; adds PHP8.1 support

This commit is contained in:
David Goodwin
2022-06-28 13:56:41 +01:00
parent 835fd87d5f
commit 58e9538e6a
97 changed files with 3150 additions and 4677 deletions

View File

@@ -138,7 +138,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
* test if cache is valid
*
* @api Smarty::isCached()
* @link http://www.smarty.net/docs/en/api.is.cached.tpl
* @link https://www.smarty.net/docs/en/api.is.cached.tpl
*
* @param null|string|\Smarty_Internal_Template $template the resource handle of the template file or template
* object
@@ -199,6 +199,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
try {
$_smarty_old_error_level =
isset($smarty->error_reporting) ? error_reporting($smarty->error_reporting) : null;
if ($smarty->isMutingUndefinedOrNullWarnings()) {
$errorHandler = new Smarty_Internal_ErrorHandler();
$errorHandler->activate();
}
if ($this->_objType === 2) {
/* @var Smarty_Internal_Template $this */
$template->tplFunctions = $this->tplFunctions;
@@ -242,6 +248,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
}
}
}
if (isset($errorHandler)) {
$errorHandler->deactivate();
}
if (isset($_smarty_old_error_level)) {
error_reporting($_smarty_old_error_level);
}
@@ -250,6 +261,10 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
while (ob_get_level() > $level) {
ob_end_clean();
}
if (isset($errorHandler)) {
$errorHandler->deactivate();
}
if (isset($_smarty_old_error_level)) {
error_reporting($_smarty_old_error_level);
}
@@ -261,11 +276,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
* Registers plugin to be used in templates
*
* @api Smarty::registerPlugin()
* @link http://www.smarty.net/docs/en/api.register.plugin.tpl
* @link https://www.smarty.net/docs/en/api.register.plugin.tpl
*
* @param string $type plugin type
* @param string $name name of template tag
* @param callback $callback PHP callback to register
* @param callable $callback PHP callback to register
* @param bool $cacheable if true (default) this function is cache able
* @param mixed $cache_attr caching attributes if any
*
@@ -281,7 +296,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
* load a filter of specified type and name
*
* @api Smarty::loadFilter()
* @link http://www.smarty.net/docs/en/api.load.filter.tpl
* @link https://www.smarty.net/docs/en/api.load.filter.tpl
*
* @param string $type filter type
* @param string $name filter name
@@ -298,10 +313,10 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
* Registers a filter function
*
* @api Smarty::registerFilter()
* @link http://www.smarty.net/docs/en/api.register.filter.tpl
* @link https://www.smarty.net/docs/en/api.register.filter.tpl
*
* @param string $type filter type
* @param callback $callback
* @param callable $callback
* @param string|null $name optional filter name
*
* @return \Smarty|\Smarty_Internal_Template
@@ -316,7 +331,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
* Registers object to be used in templates
*
* @api Smarty::registerObject()
* @link http://www.smarty.net/docs/en/api.register.object.tpl
* @link https://www.smarty.net/docs/en/api.register.object.tpl
*
* @param string $object_name
* @param object $object the referenced PHP object to register