From 907bd7ee4632f87aec723e709e198bbf48ab6fbe Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Wed, 25 Sep 2019 13:55:07 +0100 Subject: [PATCH] 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)." --- lib/smarty/libs/Autoloader.php | 12 +- lib/smarty/libs/Smarty.class.php | 229 +- lib/smarty/libs/SmartyBC.class.php | 45 +- lib/smarty/libs/bootstrap.php | 7 +- lib/smarty/libs/debug.tpl | 6 +- lib/smarty/libs/plugins/block.textformat.php | 40 +- lib/smarty/libs/plugins/function.counter.php | 15 +- lib/smarty/libs/plugins/function.cycle.php | 33 +- lib/smarty/libs/plugins/function.fetch.php | 21 +- .../libs/plugins/function.html_checkboxes.php | 168 +- .../libs/plugins/function.html_image.php | 39 +- .../libs/plugins/function.html_options.php | 101 +- .../libs/plugins/function.html_radios.php | 147 +- .../plugins/function.html_select_date.php | 129 +- .../plugins/function.html_select_time.php | 142 +- .../libs/plugins/function.html_table.php | 44 +- lib/smarty/libs/plugins/function.mailto.php | 42 +- lib/smarty/libs/plugins/function.math.php | 49 +- .../libs/plugins/modifier.capitalize.php | 61 +- .../libs/plugins/modifier.date_format.php | 36 +- .../libs/plugins/modifier.debug_print_var.php | 43 +- lib/smarty/libs/plugins/modifier.escape.php | 132 +- .../libs/plugins/modifier.mb_wordwrap.php | 26 +- .../libs/plugins/modifier.regex_replace.php | 11 +- lib/smarty/libs/plugins/modifier.replace.php | 6 +- lib/smarty/libs/plugins/modifier.spacify.php | 3 +- lib/smarty/libs/plugins/modifier.truncate.php | 18 +- .../libs/plugins/modifiercompiler.cat.php | 5 +- .../modifiercompiler.count_characters.php | 4 +- .../modifiercompiler.count_paragraphs.php | 5 +- .../modifiercompiler.count_sentences.php | 5 +- .../plugins/modifiercompiler.count_words.php | 1 - .../libs/plugins/modifiercompiler.default.php | 3 - .../libs/plugins/modifiercompiler.escape.php | 33 +- .../plugins/modifiercompiler.from_charset.php | 3 - .../libs/plugins/modifiercompiler.indent.php | 3 - .../libs/plugins/modifiercompiler.lower.php | 2 - .../libs/plugins/modifiercompiler.noprint.php | 3 +- .../modifiercompiler.string_format.php | 1 - .../libs/plugins/modifiercompiler.strip.php | 3 - .../plugins/modifiercompiler.strip_tags.php | 1 - .../plugins/modifiercompiler.to_charset.php | 3 - .../plugins/modifiercompiler.unescape.php | 6 - .../libs/plugins/modifiercompiler.upper.php | 1 - .../plugins/modifiercompiler.wordwrap.php | 2 +- .../plugins/outputfilter.trimwhitespace.php | 46 +- .../plugins/shared.escape_special_chars.php | 6 +- .../plugins/shared.literal_compiler_param.php | 9 +- .../libs/plugins/shared.make_timestamp.php | 24 +- .../libs/plugins/shared.mb_str_replace.php | 10 +- lib/smarty/libs/plugins/shared.mb_unicode.php | 5 +- .../libs/sysplugins/smarty_cacheresource.php | 19 +- .../smarty_cacheresource_custom.php | 123 +- .../smarty_cacheresource_keyvaluestore.php | 208 +- lib/smarty/libs/sysplugins/smarty_data.php | 4 +- .../libs/sysplugins/smarty_internal_block.php | 2 +- .../smarty_internal_cacheresource_file.php | 42 +- .../smarty_internal_compile_append.php | 4 +- .../smarty_internal_compile_assign.php | 16 +- .../smarty_internal_compile_block.php | 57 +- .../smarty_internal_compile_block_child.php | 4 +- .../smarty_internal_compile_block_parent.php | 4 +- .../smarty_internal_compile_break.php | 22 +- .../smarty_internal_compile_call.php | 4 +- .../smarty_internal_compile_capture.php | 35 +- .../smarty_internal_compile_child.php | 22 +- .../smarty_internal_compile_config_load.php | 16 +- .../smarty_internal_compile_continue.php | 8 +- .../smarty_internal_compile_debug.php | 6 +- .../smarty_internal_compile_eval.php | 9 +- .../smarty_internal_compile_extends.php | 31 +- .../smarty_internal_compile_for.php | 28 +- .../smarty_internal_compile_foreach.php | 38 +- .../smarty_internal_compile_function.php | 80 +- .../sysplugins/smarty_internal_compile_if.php | 30 +- .../smarty_internal_compile_include.php | 48 +- .../smarty_internal_compile_include_php.php | 8 +- .../smarty_internal_compile_insert.php | 22 +- .../smarty_internal_compile_ldelim.php | 4 +- .../smarty_internal_compile_make_nocache.php | 4 +- .../smarty_internal_compile_nocache.php | 6 +- .../smarty_internal_compile_parent.php | 5 +- ..._internal_compile_private_block_plugin.php | 35 +- ...nternal_compile_private_foreachsection.php | 82 +- ...ternal_compile_private_function_plugin.php | 20 +- ...arty_internal_compile_private_modifier.php | 50 +- ..._compile_private_object_block_function.php | 6 +- ...ternal_compile_private_object_function.php | 15 +- .../smarty_internal_compile_private_php.php | 89 +- ...ernal_compile_private_print_expression.php | 56 +- ...ernal_compile_private_registered_block.php | 6 +- ...al_compile_private_registered_function.php | 23 +- ...ernal_compile_private_special_variable.php | 36 +- .../smarty_internal_compile_rdelim.php | 4 +- .../smarty_internal_compile_section.php | 111 +- .../smarty_internal_compile_setfilter.php | 8 +- ...ty_internal_compile_shared_inheritance.php | 19 +- .../smarty_internal_compile_while.php | 20 +- .../smarty_internal_compilebase.php | 30 +- .../smarty_internal_config_file_compiler.php | 27 +- .../smarty_internal_configfilelexer.php | 208 +- .../smarty_internal_configfileparser.php | 279 +- .../libs/sysplugins/smarty_internal_data.php | 64 +- .../libs/sysplugins/smarty_internal_debug.php | 24 +- .../smarty_internal_errorhandler.php | 29 +- .../smarty_internal_extension_handler.php | 119 +- ...rty_internal_method_addautoloadfilters.php | 23 +- ...ty_internal_method_adddefaultmodifiers.php | 4 +- .../smarty_internal_method_append.php | 14 +- .../smarty_internal_method_appendbyref.php | 9 +- .../smarty_internal_method_assignbyref.php | 6 +- .../smarty_internal_method_assignglobal.php | 9 +- .../smarty_internal_method_clearallassign.php | 3 +- .../smarty_internal_method_clearallcache.php | 8 +- .../smarty_internal_method_clearassign.php | 5 +- .../smarty_internal_method_clearcache.php | 25 +- ..._internal_method_clearcompiledtemplate.php | 43 +- .../smarty_internal_method_clearconfig.php | 4 +- ...marty_internal_method_compileallconfig.php | 23 +- ...ty_internal_method_compilealltemplates.php | 61 +- .../smarty_internal_method_configload.php | 22 +- .../smarty_internal_method_createdata.php | 4 +- ...rty_internal_method_getautoloadfilters.php | 4 +- ...arty_internal_method_getconfigvariable.php | 2 +- .../smarty_internal_method_getconfigvars.php | 6 +- ...marty_internal_method_getdebugtemplate.php | 2 +- ...ty_internal_method_getdefaultmodifiers.php | 2 +- .../smarty_internal_method_getglobal.php | 8 +- ...ty_internal_method_getregisteredobject.php | 4 +- ...arty_internal_method_getstreamvariable.php | 5 +- .../smarty_internal_method_gettags.php | 2 +- ...smarty_internal_method_gettemplatevars.php | 30 +- .../smarty_internal_method_literals.php | 18 +- .../smarty_internal_method_loadfilter.php | 6 +- .../smarty_internal_method_loadplugin.php | 12 +- .../smarty_internal_method_mustcompile.php | 3 +- ..._internal_method_registercacheresource.php | 12 +- .../smarty_internal_method_registerclass.php | 6 +- ...al_method_registerdefaultconfighandler.php | 6 +- ...al_method_registerdefaultpluginhandler.php | 4 +- ..._method_registerdefaulttemplatehandler.php | 26 +- .../smarty_internal_method_registerfilter.php | 11 +- .../smarty_internal_method_registerobject.php | 42 +- .../smarty_internal_method_registerplugin.php | 25 +- ...marty_internal_method_registerresource.php | 14 +- ...rty_internal_method_setautoloadfilters.php | 19 +- ...marty_internal_method_setdebugtemplate.php | 4 +- ...ty_internal_method_setdefaultmodifiers.php | 6 +- .../smarty_internal_method_unloadfilter.php | 8 +- ...nternal_method_unregistercacheresource.php | 6 +- ...marty_internal_method_unregisterfilter.php | 6 +- ...marty_internal_method_unregisterobject.php | 4 +- ...marty_internal_method_unregisterplugin.php | 6 +- ...rty_internal_method_unregisterresource.php | 4 +- .../smarty_internal_nocache_insert.php | 11 +- .../sysplugins/smarty_internal_parsetree.php | 4 - .../smarty_internal_parsetree_dq.php | 20 +- .../smarty_internal_parsetree_tag.php | 2 - .../smarty_internal_parsetree_template.php | 21 +- .../smarty_internal_resource_eval.php | 17 +- .../smarty_internal_resource_extends.php | 2 - .../smarty_internal_resource_file.php | 196 +- .../smarty_internal_resource_php.php | 29 +- .../smarty_internal_resource_registered.php | 28 +- .../smarty_internal_resource_stream.php | 9 +- .../smarty_internal_resource_string.php | 18 +- .../smarty_internal_runtime_cachemodify.php | 11 +- ...rty_internal_runtime_cacheresourcefile.php | 11 +- .../smarty_internal_runtime_capture.php | 29 +- .../smarty_internal_runtime_codeframe.php | 41 +- .../smarty_internal_runtime_filterhandler.php | 8 +- .../smarty_internal_runtime_foreach.php | 49 +- ...smarty_internal_runtime_getincludepath.php | 14 +- .../smarty_internal_runtime_inheritance.php | 45 +- .../smarty_internal_runtime_make_nocache.php | 6 +- .../smarty_internal_runtime_tplfunction.php | 34 +- .../smarty_internal_runtime_updatecache.php | 52 +- .../smarty_internal_runtime_updatescope.php | 28 +- .../smarty_internal_runtime_writefile.php | 7 +- ...smarty_internal_smartytemplatecompiler.php | 32 +- .../sysplugins/smarty_internal_template.php | 229 +- .../smarty_internal_templatebase.php | 93 +- .../smarty_internal_templatecompilerbase.php | 505 +-- .../smarty_internal_templatelexer.php | 310 +- .../smarty_internal_templateparser.php | 2942 ++++++++--------- .../smarty_internal_testinstall.php | 336 +- .../sysplugins/smarty_internal_undefined.php | 9 +- .../libs/sysplugins/smarty_resource.php | 72 +- .../sysplugins/smarty_resource_custom.php | 12 +- .../sysplugins/smarty_resource_recompiled.php | 7 +- .../libs/sysplugins/smarty_security.php | 228 +- .../sysplugins/smarty_template_cached.php | 20 +- .../sysplugins/smarty_template_compiled.php | 21 +- .../sysplugins/smarty_template_config.php | 19 +- .../smarty_template_resource_base.php | 3 +- .../sysplugins/smarty_template_source.php | 17 +- .../sysplugins/smarty_undefined_variable.php | 4 +- .../libs/sysplugins/smarty_variable.php | 3 +- lib/smarty/smarty_version | 4 +- 199 files changed, 5335 insertions(+), 4857 deletions(-) diff --git a/lib/smarty/libs/Autoloader.php b/lib/smarty/libs/Autoloader.php index 3a0da8fa..e4dc450f 100644 --- a/lib/smarty/libs/Autoloader.php +++ b/lib/smarty/libs/Autoloader.php @@ -2,14 +2,14 @@ /** * Smarty Autoloader * - * @package Smarty + * @package Smarty */ /** * Smarty Autoloader * - * @package Smarty - * @author Uwe Tews + * @package Smarty + * @author Uwe Tews * Usage: * require_once '...path/Autoloader.php'; * Smarty_Autoloader::register(); @@ -20,7 +20,7 @@ */ class Smarty_Autoloader { - /** + /** * Filepath to Smarty root * * @var string @@ -54,8 +54,8 @@ class Smarty_Autoloader if (!defined('SMARTY_SPL_AUTOLOAD')) { define('SMARTY_SPL_AUTOLOAD', 0); } - if (SMARTY_SPL_AUTOLOAD && - set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false + if (SMARTY_SPL_AUTOLOAD + && set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false ) { $registeredAutoLoadFunctions = spl_autoload_functions(); if (!isset($registeredAutoLoadFunctions[ 'spl_autoload' ])) { diff --git a/lib/smarty/libs/Smarty.class.php b/lib/smarty/libs/Smarty.class.php index 597fbbf0..a8969926 100644 --- a/lib/smarty/libs/Smarty.class.php +++ b/lib/smarty/libs/Smarty.class.php @@ -27,7 +27,7 @@ * @author Uwe Tews * @author Rodney Rehm * @package Smarty - * @version 3.1.32 + * @version 3.1.33 */ /** * set SMARTY_DIR to absolute path to Smarty library files. @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32'; + const SMARTY_VERSION = '3.1.33'; /** * define variable scopes */ @@ -166,133 +166,157 @@ class Smarty extends Smarty_Internal_TemplateBase const PLUGIN_COMPILER = 'compiler'; const PLUGIN_MODIFIER = 'modifier'; const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler'; + /** * assigned global tpl vars */ public static $global_tpl_vars = array(); + /** * Flag denoting if Multibyte String functions are available */ public static $_MBSTRING = SMARTY_MBSTRING; + /** * The character set to adhere to (e.g. "UTF-8") */ public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET; + /** * The date format to be used internally * (accepts date() and strftime()) */ public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT; + /** * Flag denoting if PCRE should run in UTF-8 mode */ public static $_UTF8_MODIFIER = 'u'; + /** * Flag denoting if operating system is windows */ public static $_IS_WINDOWS = false; + /** * auto literal on delimiters with whitespace * * @var boolean */ public $auto_literal = true; + /** * display error on not assigned variables * * @var boolean */ public $error_unassigned = false; + /** * look up relative file path in include_path * * @var boolean */ public $use_include_path = false; + /** * flag if template_dir is normalized * * @var bool */ public $_templateDirNormalized = false; + /** * joined template directory string used in cache keys * * @var string */ public $_joined_template_dir = null; + /** * flag if config_dir is normalized * * @var bool */ public $_configDirNormalized = false; + /** * joined config directory string used in cache keys * * @var string */ public $_joined_config_dir = null; + /** * default template handler * * @var callable */ public $default_template_handler_func = null; + /** * default config handler * * @var callable */ public $default_config_handler_func = null; + /** * default plugin handler * * @var callable */ public $default_plugin_handler_func = null; + /** * flag if template_dir is normalized * * @var bool */ public $_compileDirNormalized = false; + /** * flag if plugins_dir is normalized * * @var bool */ public $_pluginsDirNormalized = false; + /** * flag if template_dir is normalized * * @var bool */ public $_cacheDirNormalized = false; + /** * force template compiling? * * @var boolean */ public $force_compile = false; - /** + + /** * use sub dirs for compiled/cached files? * * @var boolean */ public $use_sub_dirs = false; + /** * allow ambiguous resources (that are made unique by the resource handler) * * @var boolean */ public $allow_ambiguous_resources = false; + /** * merge compiled includes * * @var boolean */ public $merge_compiled_includes = false; + /* * flag for behaviour when extends: resource and {extends} tag are used simultaneous * if false disable execution of {extends} in templates called by extends resource. @@ -301,30 +325,35 @@ class Smarty extends Smarty_Internal_TemplateBase * @var boolean */ public $extends_recursion = true; + /** * force cache file creation * * @var boolean */ public $force_cache = false; + /** * template left-delimiter * * @var string */ public $left_delimiter = "{"; + /** * template right-delimiter * * @var string */ public $right_delimiter = "}"; + /** * array of strings which shall be treated as literal by compiler * * @var array string */ public $literals = array(); + /** * class name * This should be instance of Smarty_Security. @@ -333,24 +362,28 @@ class Smarty extends Smarty_Internal_TemplateBase * @see Smarty_Security */ public $security_class = 'Smarty_Security'; + /** * implementation of security class * * @var Smarty_Security */ public $security_policy = null; + /** * controls handling of PHP-blocks * * @var integer */ public $php_handling = self::PHP_PASSTHRU; + /** * controls if the php template file resource is allowed * * @var bool */ public $allow_php_templates = false; + /** * debug mode * Setting this to true enables the debug-console. @@ -358,6 +391,7 @@ class Smarty extends Smarty_Internal_TemplateBase * @var boolean */ public $debugging = false; + /** * This determines if debugging is enable-able from the browser. *