From f5a36f99e8edb89af6f5c7f6eabbd19c363fb638 Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 6 Aug 2024 02:03:56 +0000 Subject: [PATCH 1/2] Update Smarty5 to latest released version --- smarty5/composer.lock | 24 +++--- smarty5/vendor/composer/installed.json | 28 +++---- smarty5/vendor/composer/installed.php | 16 ++-- smarty5/vendor/smarty/smarty/CHANGELOG.md | 13 +++- .../smarty/smarty/docs/api/configuring.md | 23 +++--- .../vendor/smarty/smarty/docs/img/smarty.svg | 22 ++++++ .../smarty/smarty/src/Compile/Tag/Section.php | 2 +- .../smarty/src/Compile/Tag/SectionClose.php | 2 +- smarty5/vendor/smarty/smarty/src/Data.php | 2 +- smarty5/vendor/smarty/smarty/src/Smarty.php | 17 +++- .../symfony/polyfill-mbstring/Mbstring.php | 77 +++++++++++++++---- .../symfony/polyfill-mbstring/bootstrap.php | 8 ++ .../symfony/polyfill-mbstring/bootstrap80.php | 8 ++ 13 files changed, 178 insertions(+), 64 deletions(-) create mode 100644 smarty5/vendor/smarty/smarty/docs/img/smarty.svg diff --git a/smarty5/composer.lock b/smarty5/composer.lock index 9f7d6a08c..a98c13d9b 100644 --- a/smarty5/composer.lock +++ b/smarty5/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "smarty/smarty", - "version": "v5.2.0", + "version": "v5.3.1", "source": { "type": "git", "url": "https://github.com/smarty-php/smarty.git", - "reference": "cdee97d3f1dff597be8583625adb42710da2c885" + "reference": "3cb35854326a94120cd415b81db28c53d95d0d5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/smarty-php/smarty/zipball/cdee97d3f1dff597be8583625adb42710da2c885", - "reference": "cdee97d3f1dff597be8583625adb42710da2c885", + "url": "https://api.github.com/repos/smarty-php/smarty/zipball/3cb35854326a94120cd415b81db28c53d95d0d5d", + "reference": "3cb35854326a94120cd415b81db28c53d95d0d5d", "shasum": "" }, "require": { @@ -72,22 +72,22 @@ "support": { "forum": "https://github.com/smarty-php/smarty/discussions", "issues": "https://github.com/smarty-php/smarty/issues", - "source": "https://github.com/smarty-php/smarty/tree/v5.2.0" + "source": "https://github.com/smarty-php/smarty/tree/v5.3.1" }, - "time": "2024-05-28T21:45:16+00:00" + "time": "2024-06-16T19:51:13+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -138,7 +138,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -154,7 +154,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" } ], "packages-dev": [], diff --git a/smarty5/vendor/composer/installed.json b/smarty5/vendor/composer/installed.json index 56cb4d328..2e3bbfb3d 100644 --- a/smarty5/vendor/composer/installed.json +++ b/smarty5/vendor/composer/installed.json @@ -2,17 +2,17 @@ "packages": [ { "name": "smarty/smarty", - "version": "v5.2.0", - "version_normalized": "5.2.0.0", + "version": "v5.3.1", + "version_normalized": "5.3.1.0", "source": { "type": "git", "url": "https://github.com/smarty-php/smarty.git", - "reference": "cdee97d3f1dff597be8583625adb42710da2c885" + "reference": "3cb35854326a94120cd415b81db28c53d95d0d5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/smarty-php/smarty/zipball/cdee97d3f1dff597be8583625adb42710da2c885", - "reference": "cdee97d3f1dff597be8583625adb42710da2c885", + "url": "https://api.github.com/repos/smarty-php/smarty/zipball/3cb35854326a94120cd415b81db28c53d95d0d5d", + "reference": "3cb35854326a94120cd415b81db28c53d95d0d5d", "shasum": "" }, "require": { @@ -23,7 +23,7 @@ "phpunit/phpunit": "^8.5 || ^7.5", "smarty/smarty-lexer": "^4.0.2" }, - "time": "2024-05-28T21:45:16+00:00", + "time": "2024-06-16T19:51:13+00:00", "type": "library", "extra": { "branch-alias": { @@ -69,23 +69,23 @@ "support": { "forum": "https://github.com/smarty-php/smarty/discussions", "issues": "https://github.com/smarty-php/smarty/issues", - "source": "https://github.com/smarty-php/smarty/tree/v5.2.0" + "source": "https://github.com/smarty-php/smarty/tree/v5.3.1" }, "install-path": "../smarty/smarty" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", - "version_normalized": "1.29.0.0", + "version": "v1.30.0", + "version_normalized": "1.30.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -97,7 +97,7 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2024-01-29T20:11:03+00:00", + "time": "2024-06-19T12:30:46+00:00", "type": "library", "extra": { "thanks": { @@ -138,7 +138,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { diff --git a/smarty5/vendor/composer/installed.php b/smarty5/vendor/composer/installed.php index 0f3523f38..4e67c211b 100644 --- a/smarty5/vendor/composer/installed.php +++ b/smarty5/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'bfa3c101f9cdda54c10fa607846ea1bafe388fce', + 'reference' => '3ff6798863d74e4dbb710295c6076dc750807404', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,25 +13,25 @@ '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'bfa3c101f9cdda54c10fa607846ea1bafe388fce', + 'reference' => '3ff6798863d74e4dbb710295c6076dc750807404', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), 'smarty/smarty' => array( - 'pretty_version' => 'v5.2.0', - 'version' => '5.2.0.0', - 'reference' => 'cdee97d3f1dff597be8583625adb42710da2c885', + 'pretty_version' => 'v5.3.1', + 'version' => '5.3.1.0', + 'reference' => '3cb35854326a94120cd415b81db28c53d95d0d5d', 'type' => 'library', 'install_path' => __DIR__ . '/../smarty/smarty', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.29.0', - 'version' => '1.29.0.0', - 'reference' => '9773676c8a1bb1f8d4340a62efe641cf76eda7ec', + 'pretty_version' => 'v1.30.0', + 'version' => '1.30.0.0', + 'reference' => 'fd22ab50000ef01661e2a31d850ebaa297f8e03c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), diff --git a/smarty5/vendor/smarty/smarty/CHANGELOG.md b/smarty5/vendor/smarty/smarty/CHANGELOG.md index f359cec2c..8d9033526 100644 --- a/smarty5/vendor/smarty/smarty/CHANGELOG.md +++ b/smarty5/vendor/smarty/smarty/CHANGELOG.md @@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [5.3.1] - 2024-06-16 +- Fixed error when using section with nocache [#1034](https://github.com/smarty-php/smarty/issues/1034) + + +## [5.3.0] - 2024-05-30 +- Fix warning when calling hasVariable for an undefined variable [#977](https://github.com/smarty-php/smarty/issues/977) +- Added `$smarty->prependTemplateDir()` method [#1022](https://github.com/smarty-php/smarty/issues/1022) + + ## [5.2.0] - 2024-05-28 - Fixed a code injection vulnerability in extends-tag. This addresses CVE-2024-35226. - Added `$smarty->setCacheModifiedCheck()` setter for cache_modified_check @@ -22,16 +31,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Internal compiler classes always return a string (the internal has_code flag has been removed for simplicity) [#918](https://github.com/smarty-php/smarty/pull/918) - Fix invalid classnames in Runtime code for foreach [#1000](https://github.com/smarty-php/smarty/issues/1000) +## [5.0.2] - 2024-03-28 +- Fix Smarty::assign() not returning $this when called with an array as first parameter [#972](https://github.com/smarty-php/smarty/pull/972) ## [5.0.1] - 2024-03-27 - Fix error in Smarty\Smarty::compileAllTemplates() by including missing FilesystemIterator class [#966](https://github.com/smarty-php/smarty/issues/966) - ## [5.0.0] - 2024-03-25 - Fixed that scoped variables would overwrite parent scope [#952](https://github.com/smarty-php/smarty/issues/952) - Removed publicly accessible `$tpl->_var_stack` variable - ### Fixed - Too many shorthand attributes error when using a modifier as a function with more than 3 parameters in an expression [#949](https://github.com/smarty-php/smarty/issues/949) diff --git a/smarty5/vendor/smarty/smarty/docs/api/configuring.md b/smarty5/vendor/smarty/smarty/docs/api/configuring.md index 4c1c91fa7..ee2ebf7e9 100644 --- a/smarty5/vendor/smarty/smarty/docs/api/configuring.md +++ b/smarty5/vendor/smarty/smarty/docs/api/configuring.md @@ -12,24 +12,27 @@ Use `getTemplateDir()` to retrieve the configured paths. setTemplateDir('./config'); +$smarty->setTemplateDir('./templates'); -// set multiple directories where config files are stored -$smarty->setTemplateDir(['./config', './config_2', './config_3']); +// set multiple directories where templates are stored +$smarty->setTemplateDir(['./templates', './templates_2', './templates_3']); -// add directory where config files are stored to the current list of dirs -$smarty->addTemplateDir('./config_1'); +// add directory where templates files are stored to the current list of dirs +$smarty->addTemplateDir('./templates_1'); // add multiple directories to the current list of dirs $smarty->addTemplateDir([ - './config_2', - './config_3', + './templates_2', + './templates_3', ]); // chaining of method calls -$smarty->setTemplateDir('./config') - ->addTemplateDir('./config_1') - ->addTemplateDir('./config_2'); +$smarty->setTemplateDir('./templates') + ->addTemplateDir('./templates_1') + ->addTemplateDir('./templates_2'); + +// insert a template dir before exising template dirs +$smarty->prependTemplateDir('./more_important_templates') // get all directories where config files are stored $template_dirs = $smarty->getTemplateDir(); diff --git a/smarty5/vendor/smarty/smarty/docs/img/smarty.svg b/smarty5/vendor/smarty/smarty/docs/img/smarty.svg new file mode 100644 index 000000000..cd8c86639 --- /dev/null +++ b/smarty5/vendor/smarty/smarty/docs/img/smarty.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/smarty5/vendor/smarty/smarty/src/Compile/Tag/Section.php b/smarty5/vendor/smarty/smarty/src/Compile/Tag/Section.php index f82ac4211..136591174 100644 --- a/smarty5/vendor/smarty/smarty/src/Compile/Tag/Section.php +++ b/smarty5/vendor/smarty/smarty/src/Compile/Tag/Section.php @@ -99,7 +99,7 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = if ($compiler->tag_nocache) { // push a {nocache} tag onto the stack to prevent caching of this block - $this->openTag('nocache'); + $this->openTag($compiler, 'nocache'); } $this->openTag($compiler, 'section', ['section', $compiler->tag_nocache]); diff --git a/smarty5/vendor/smarty/smarty/src/Compile/Tag/SectionClose.php b/smarty5/vendor/smarty/smarty/src/Compile/Tag/SectionClose.php index efab60975..24c79c32a 100644 --- a/smarty5/vendor/smarty/smarty/src/Compile/Tag/SectionClose.php +++ b/smarty5/vendor/smarty/smarty/src/Compile/Tag/SectionClose.php @@ -33,7 +33,7 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = if ($nocache_pushed) { // pop the pushed virtual nocache tag - $this->closeTag('nocache'); + $this->closeTag($compiler, 'nocache'); } $output = "getVariable($varName) instanceof UndefinedVariable); + return !($this->getVariable($varName, true, false) instanceof UndefinedVariable); } /** diff --git a/smarty5/vendor/smarty/smarty/src/Smarty.php b/smarty5/vendor/smarty/smarty/src/Smarty.php index 5af9c9b36..339103247 100644 --- a/smarty5/vendor/smarty/smarty/src/Smarty.php +++ b/smarty5/vendor/smarty/smarty/src/Smarty.php @@ -54,7 +54,7 @@ class Smarty extends \Smarty\TemplateBase { /** * smarty version */ - const SMARTY_VERSION = '5.2.0'; + const SMARTY_VERSION = '5.3.1'; /** * define caching modes @@ -684,6 +684,21 @@ public function setTemplateDir($template_dir, $isConfig = false) { return $this; } + /** + * Adds a template directory before any existing directoires + * + * @param string $new_template_dir directory of template sources + * @param bool $is_config true for config_dir + * + * @return static current Smarty instance for chaining + */ + public function prependTemplateDir($new_template_dir, $is_config = false) { + $current_template_dirs = $is_config ? $this->config_dir : $this->template_dir; + array_unshift($current_template_dirs, $new_template_dir); + $this->setTemplateDir($current_template_dirs, $is_config); + return $this; + } + /** * Add config directory(s) * diff --git a/smarty5/vendor/symfony/polyfill-mbstring/Mbstring.php b/smarty5/vendor/symfony/polyfill-mbstring/Mbstring.php index 2e0b96940..1ad33a86b 100644 --- a/smarty5/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/smarty5/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -48,6 +48,8 @@ * - mb_strstr - Finds first occurrence of a string within another * - mb_strwidth - Return width of string * - mb_substr_count - Count the number of substring occurrences + * - mb_ucfirst - Make a string's first character uppercase + * - mb_lcfirst - Make a string's first character lowercase * * Not implemented: * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) @@ -80,6 +82,21 @@ final class Mbstring public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { + if (\is_array($s)) { + if (PHP_VERSION_ID < 70200) { + trigger_error('mb_convert_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); + + return null; + } + + $r = []; + foreach ($s as $str) { + $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); + } + + return $r; + } + if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { @@ -410,7 +427,7 @@ public static function mb_encoding_aliases($encoding) public static function mb_check_encoding($var = null, $encoding = null) { - if (PHP_VERSION_ID < 70200 && \is_array($var)) { + if (\PHP_VERSION_ID < 70200 && \is_array($var)) { trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); return null; @@ -437,7 +454,6 @@ public static function mb_check_encoding($var = null, $encoding = null) } return true; - } public static function mb_detect_encoding($str, $encodingList = null, $strict = false) @@ -827,7 +843,7 @@ public static function mb_ord($s, $encoding = null) return $code; } - public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, string $encoding = null): string + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string { if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); @@ -835,17 +851,8 @@ public static function mb_str_pad(string $string, int $length, string $pad_strin if (null === $encoding) { $encoding = self::mb_internal_encoding(); - } - - try { - $validEncoding = @self::mb_check_encoding('', $encoding); - } catch (\ValueError $e) { - throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); - } - - // BC for PHP 7.3 and lower - if (!$validEncoding) { - throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } else { + self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given'); } if (self::mb_strlen($pad_string, $encoding) <= 0) { @@ -871,6 +878,34 @@ public static function mb_str_pad(string $string, int $length, string $pad_strin } } + public static function mb_ucfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + public static function mb_lcfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + private static function getSubpart($pos, $part, $haystack, $encoding) { if (false === $pos) { @@ -944,4 +979,18 @@ private static function getEncoding($encoding) return $encoding; } + + private static function assertEncoding(string $encoding, string $errorFormat): void + { + try { + $validEncoding = @self::mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(\sprintf($errorFormat, $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(\sprintf($errorFormat, $encoding)); + } + } } diff --git a/smarty5/vendor/symfony/polyfill-mbstring/bootstrap.php b/smarty5/vendor/symfony/polyfill-mbstring/bootstrap.php index ecf1a0352..6e4b5fce8 100644 --- a/smarty5/vendor/symfony/polyfill-mbstring/bootstrap.php +++ b/smarty5/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -136,6 +136,14 @@ function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstrin function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } } +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + if (extension_loaded('mbstring')) { return; } diff --git a/smarty5/vendor/symfony/polyfill-mbstring/bootstrap80.php b/smarty5/vendor/symfony/polyfill-mbstring/bootstrap80.php index 2f9fb5b42..ec2ae4276 100644 --- a/smarty5/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ b/smarty5/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -132,6 +132,14 @@ function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = nul function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } } +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + if (extension_loaded('mbstring')) { return; } From 852ce9a3cce89924885205478e158fb715a7b7dc Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 6 Aug 2024 14:13:57 +1200 Subject: [PATCH 2/2] Add Smarty php8.4 support This patch is from a currently open PR https://github.com/smarty-php/smarty/pull/1043 I think we can merge this to see our 8.4 start running & be relaxed if we lose it temporarily if we update Smarty again now before it is merged (which seems unlikely but we can hopefully hustle the merge) --- .../vendor/smarty/smarty/run-tests-for-all-php-versions.sh | 1 + smarty5/vendor/smarty/smarty/src/Cacheresource/Base.php | 2 +- smarty5/vendor/smarty/smarty/src/Cacheresource/Custom.php | 2 +- smarty5/vendor/smarty/smarty/src/Cacheresource/File.php | 2 +- .../smarty/smarty/src/Cacheresource/KeyValueStore.php | 2 +- smarty5/vendor/smarty/smarty/src/Compiler/CodeFrame.php | 2 +- smarty5/vendor/smarty/smarty/src/Compiler/Template.php | 2 +- smarty5/vendor/smarty/smarty/src/CompilerException.php | 4 ++-- smarty5/vendor/smarty/smarty/src/Resource/BasePlugin.php | 2 +- smarty5/vendor/smarty/smarty/src/Resource/CustomPlugin.php | 2 +- smarty5/vendor/smarty/smarty/src/Resource/ExtendsPlugin.php | 2 +- smarty5/vendor/smarty/smarty/src/Resource/FilePlugin.php | 2 +- smarty5/vendor/smarty/smarty/src/Resource/StreamPlugin.php | 2 +- smarty5/vendor/smarty/smarty/src/Resource/StringPlugin.php | 2 +- .../vendor/smarty/smarty/src/Runtime/InheritanceRuntime.php | 2 +- smarty5/vendor/smarty/smarty/src/Template.php | 6 +++--- smarty5/vendor/smarty/smarty/src/Template/Source.php | 6 +++--- smarty5/vendor/smarty/smarty/src/TemplateBase.php | 2 +- 18 files changed, 23 insertions(+), 22 deletions(-) diff --git a/smarty5/vendor/smarty/smarty/run-tests-for-all-php-versions.sh b/smarty5/vendor/smarty/smarty/run-tests-for-all-php-versions.sh index 494b127b5..efff5713d 100755 --- a/smarty5/vendor/smarty/smarty/run-tests-for-all-php-versions.sh +++ b/smarty5/vendor/smarty/smarty/run-tests-for-all-php-versions.sh @@ -14,3 +14,4 @@ $COMPOSE_CMD run --rm php80 ./run-tests.sh $@ && \ $COMPOSE_CMD run --rm php81 ./run-tests.sh $@ && \ $COMPOSE_CMD run --rm php82 ./run-tests.sh $@ $COMPOSE_CMD run --rm php83 ./run-tests.sh $@ +$COMPOSE_CMD run --rm php84 ./run-tests.sh $@ diff --git a/smarty5/vendor/smarty/smarty/src/Cacheresource/Base.php b/smarty5/vendor/smarty/smarty/src/Cacheresource/Base.php index 54a141921..41c4f6bc6 100644 --- a/smarty5/vendor/smarty/smarty/src/Cacheresource/Base.php +++ b/smarty5/vendor/smarty/smarty/src/Cacheresource/Base.php @@ -44,7 +44,7 @@ abstract public function populateTimestamp(Cached $cached); */ abstract public function process( Template $_template, - Cached $cached = null, + ?Cached $cached = null, $update = false ); diff --git a/smarty5/vendor/smarty/smarty/src/Cacheresource/Custom.php b/smarty5/vendor/smarty/smarty/src/Cacheresource/Custom.php index c049246c8..f9eb858e4 100644 --- a/smarty5/vendor/smarty/smarty/src/Cacheresource/Custom.php +++ b/smarty5/vendor/smarty/smarty/src/Cacheresource/Custom.php @@ -139,7 +139,7 @@ public function populateTimestamp(\Smarty\Template\Cached $cached) */ public function process( Template $_smarty_tpl, - \Smarty\Template\Cached $cached = null, + ?\Smarty\Template\Cached $cached = null, $update = false ) { if (!$cached) { diff --git a/smarty5/vendor/smarty/smarty/src/Cacheresource/File.php b/smarty5/vendor/smarty/smarty/src/Cacheresource/File.php index 538f01034..4b4198ec2 100644 --- a/smarty5/vendor/smarty/smarty/src/Cacheresource/File.php +++ b/smarty5/vendor/smarty/smarty/src/Cacheresource/File.php @@ -99,7 +99,7 @@ public function populateTimestamp(Cached $cached) */ public function process( Template $_smarty_tpl, - Cached $cached = null, + ?Cached $cached = null, $update = false ) { $_smarty_tpl->getCached()->setValid(false); diff --git a/smarty5/vendor/smarty/smarty/src/Cacheresource/KeyValueStore.php b/smarty5/vendor/smarty/smarty/src/Cacheresource/KeyValueStore.php index 733d27765..1953bb20f 100644 --- a/smarty5/vendor/smarty/smarty/src/Cacheresource/KeyValueStore.php +++ b/smarty5/vendor/smarty/smarty/src/Cacheresource/KeyValueStore.php @@ -103,7 +103,7 @@ public function populateTimestamp(Cached $cached) */ public function process( Template $_smarty_tpl, - Cached $cached = null, + ?Cached $cached = null, $update = false ) { if (!$cached) { diff --git a/smarty5/vendor/smarty/smarty/src/Compiler/CodeFrame.php b/smarty5/vendor/smarty/smarty/src/Compiler/CodeFrame.php index 5e7821509..d0e1cc120 100644 --- a/smarty5/vendor/smarty/smarty/src/Compiler/CodeFrame.php +++ b/smarty5/vendor/smarty/smarty/src/Compiler/CodeFrame.php @@ -41,7 +41,7 @@ public function create( $content = '', $functions = '', $cache = false, - \Smarty\Compiler\Template $compiler = null + ?\Smarty\Compiler\Template $compiler = null ) { // build property code $properties[ 'version' ] = \Smarty\Smarty::SMARTY_VERSION; diff --git a/smarty5/vendor/smarty/smarty/src/Compiler/Template.php b/smarty5/vendor/smarty/smarty/src/Compiler/Template.php index 1d4aa2447..4954b994d 100644 --- a/smarty5/vendor/smarty/smarty/src/Compiler/Template.php +++ b/smarty5/vendor/smarty/smarty/src/Compiler/Template.php @@ -368,7 +368,7 @@ public function compileTemplate(\Smarty\Template $template) { * @throws CompilerException * @throws Exception */ - public function compileTemplateSource(\Smarty\Template $template, \Smarty\Compiler\Template $parent_compiler = null) { + public function compileTemplateSource(\Smarty\Template $template, ?\Smarty\Compiler\Template $parent_compiler = null) { try { // save template object in compiler class $this->template = $template; diff --git a/smarty5/vendor/smarty/smarty/src/CompilerException.php b/smarty5/vendor/smarty/smarty/src/CompilerException.php index e3d67b46c..60af9db7c 100644 --- a/smarty5/vendor/smarty/smarty/src/CompilerException.php +++ b/smarty5/vendor/smarty/smarty/src/CompilerException.php @@ -16,14 +16,14 @@ class CompilerException extends Exception { * @param int $code The Exception code. * @param string|null $filename The filename where the exception is thrown. * @param int|null $line The line number where the exception is thrown. - * @param Throwable|null $previous The previous exception used for the exception chaining. + * @param \Throwable|null $previous The previous exception used for the exception chaining. */ public function __construct( string $message = "", int $code = 0, ?string $filename = null, ?int $line = null, - Throwable $previous = null + ?\Throwable $previous = null ) { parent::__construct($message, $code, $previous); diff --git a/smarty5/vendor/smarty/smarty/src/Resource/BasePlugin.php b/smarty5/vendor/smarty/smarty/src/Resource/BasePlugin.php index 56f7dfa05..6d2222237 100644 --- a/smarty5/vendor/smarty/smarty/src/Resource/BasePlugin.php +++ b/smarty5/vendor/smarty/smarty/src/Resource/BasePlugin.php @@ -112,7 +112,7 @@ abstract public function getContent(Source $source); * @param Source $source source object * @param Template|null $_template template object */ - abstract public function populate(Source $source, \Smarty\Template $_template = null); + abstract public function populate(Source $source, ?\Smarty\Template $_template = null); /** * populate Source Object with timestamp and exists from Resource diff --git a/smarty5/vendor/smarty/smarty/src/Resource/CustomPlugin.php b/smarty5/vendor/smarty/smarty/src/Resource/CustomPlugin.php index b50ef7aaf..895e97108 100644 --- a/smarty5/vendor/smarty/smarty/src/Resource/CustomPlugin.php +++ b/smarty5/vendor/smarty/smarty/src/Resource/CustomPlugin.php @@ -50,7 +50,7 @@ protected function fetchTimestamp($name) { * @param Source $source source object * @param Template|null $_template template object */ - public function populate(Source $source, Template $_template = null) { + public function populate(Source $source, ?Template $_template = null) { $source->uid = sha1($source->type . ':' . $source->name); $mtime = $this->fetchTimestamp($source->name); if ($mtime !== null) { diff --git a/smarty5/vendor/smarty/smarty/src/Resource/ExtendsPlugin.php b/smarty5/vendor/smarty/smarty/src/Resource/ExtendsPlugin.php index acce54e2a..a282f9baa 100644 --- a/smarty5/vendor/smarty/smarty/src/Resource/ExtendsPlugin.php +++ b/smarty5/vendor/smarty/smarty/src/Resource/ExtendsPlugin.php @@ -23,7 +23,7 @@ class ExtendsPlugin extends BasePlugin * * @throws Exception */ - public function populate(Source $source, Template $_template = null) + public function populate(Source $source, ?Template $_template = null) { $uid = ''; $sources = array(); diff --git a/smarty5/vendor/smarty/smarty/src/Resource/FilePlugin.php b/smarty5/vendor/smarty/smarty/src/Resource/FilePlugin.php index 7fd8667d3..22b05f0cf 100644 --- a/smarty5/vendor/smarty/smarty/src/Resource/FilePlugin.php +++ b/smarty5/vendor/smarty/smarty/src/Resource/FilePlugin.php @@ -32,7 +32,7 @@ class FilePlugin extends BasePlugin { * * @throws Exception */ - public function populate(Source $source, Template $_template = null) { + public function populate(Source $source, ?Template $_template = null) { $source->uid = sha1( $source->name . ($source->isConfig ? $source->getSmarty()->_joined_config_dir : diff --git a/smarty5/vendor/smarty/smarty/src/Resource/StreamPlugin.php b/smarty5/vendor/smarty/smarty/src/Resource/StreamPlugin.php index 91afffdcd..9b5b3f579 100644 --- a/smarty5/vendor/smarty/smarty/src/Resource/StreamPlugin.php +++ b/smarty5/vendor/smarty/smarty/src/Resource/StreamPlugin.php @@ -33,7 +33,7 @@ class StreamPlugin extends RecompiledPlugin { * * @return void */ - public function populate(Source $source, Template $_template = null) { + public function populate(Source $source, ?Template $_template = null) { $source->uid = false; $source->content = $this->getContent($source); $source->timestamp = $source->exists = !!$source->content; diff --git a/smarty5/vendor/smarty/smarty/src/Resource/StringPlugin.php b/smarty5/vendor/smarty/smarty/src/Resource/StringPlugin.php index 6b5bee4dd..fb3692c73 100644 --- a/smarty5/vendor/smarty/smarty/src/Resource/StringPlugin.php +++ b/smarty5/vendor/smarty/smarty/src/Resource/StringPlugin.php @@ -31,7 +31,7 @@ class StringPlugin extends BasePlugin { * * @return void */ - public function populate(Source $source, Template $_template = null) { + public function populate(Source $source, ?Template $_template = null) { $source->uid = sha1($source->name); $source->timestamp = $source->exists = true; } diff --git a/smarty5/vendor/smarty/smarty/src/Runtime/InheritanceRuntime.php b/smarty5/vendor/smarty/smarty/src/Runtime/InheritanceRuntime.php index ffd7aae66..74ea85440 100644 --- a/smarty5/vendor/smarty/smarty/src/Runtime/InheritanceRuntime.php +++ b/smarty5/vendor/smarty/smarty/src/Runtime/InheritanceRuntime.php @@ -162,7 +162,7 @@ public function instanceBlock(Template $tpl, $className, $name, $tplIndex = null private function processBlock( Template $tpl, \Smarty\Runtime\Block $block, - \Smarty\Runtime\Block $parent = null + ?\Smarty\Runtime\Block $parent = null ) { if ($block->hide && !isset($block->child)) { return; diff --git a/smarty5/vendor/smarty/smarty/src/Template.php b/smarty5/vendor/smarty/smarty/src/Template.php index fcb0f58d2..242fb2388 100644 --- a/smarty5/vendor/smarty/smarty/src/Template.php +++ b/smarty5/vendor/smarty/smarty/src/Template.php @@ -115,7 +115,7 @@ class Template extends TemplateBase { public function __construct( $template_resource, Smarty $smarty, - \Smarty\Data $_parent = null, + ?\Smarty\Data $_parent = null, $_cache_id = null, $_compile_id = null, $_caching = null, @@ -248,7 +248,7 @@ public function renderSubTemplate( $caching, $cache_lifetime, array $extra_vars = [], - int $scope = null, + ?int $scope = null, ?string $currentDir = null ) { @@ -462,7 +462,7 @@ public function getCompiler() { * @return string * @throws Exception */ - public function createCodeFrame($content = '', $functions = '', $cache = false, \Smarty\Compiler\Template $compiler = null) { + public function createCodeFrame($content = '', $functions = '', $cache = false, ?\Smarty\Compiler\Template $compiler = null) { return $this->getCodeFrameCompiler()->create($content, $functions, $cache, $compiler); } diff --git a/smarty5/vendor/smarty/smarty/src/Template/Source.php b/smarty5/vendor/smarty/smarty/src/Template/Source.php index 382e710a7..2ef13a48c 100644 --- a/smarty5/vendor/smarty/smarty/src/Template/Source.php +++ b/smarty5/vendor/smarty/smarty/src/Template/Source.php @@ -134,9 +134,9 @@ public function __construct(Smarty $smarty, $type, $name) { * @throws Exception */ public static function load( - Template $_template = null, - Smarty $smarty = null, - $template_resource = null + ?Template $_template = null, + ?Smarty $smarty = null, + $template_resource = null ) { if ($_template) { $smarty = $_template->getSmarty(); diff --git a/smarty5/vendor/smarty/smarty/src/TemplateBase.php b/smarty5/vendor/smarty/smarty/src/TemplateBase.php index 3674edf7c..f01d11076 100644 --- a/smarty5/vendor/smarty/smarty/src/TemplateBase.php +++ b/smarty5/vendor/smarty/smarty/src/TemplateBase.php @@ -179,7 +179,7 @@ public function setCacheId($cache_id) { * @api Smarty::createData() * */ - public function createData(Data $parent = null, $name = null) { + public function createData(?Data $parent = null, $name = null) { /* @var Smarty $smarty */ $smarty = $this->getSmarty(); $dataObj = new Data($parent, $smarty, $name);