From bf9a48f63d670fd87d6fc4a9b8d34c1e59f04c52 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 13 Dec 2023 15:06:38 +0100 Subject: [PATCH] fixes #2066 keep Smarty compatible with PHP 7.0 --- include/smarty/libs/plugins/modifier.explode.php | 2 +- include/smarty/libs/plugins/modifier.number_format.php | 2 +- include/smarty/libs/sysplugins/smartycompilerexception.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/smarty/libs/plugins/modifier.explode.php b/include/smarty/libs/plugins/modifier.explode.php index 5186fde3d..527d29771 100644 --- a/include/smarty/libs/plugins/modifier.explode.php +++ b/include/smarty/libs/plugins/modifier.explode.php @@ -18,7 +18,7 @@ * * @return array */ -function smarty_modifier_explode($separator, $string, ?int $limit = null) +function smarty_modifier_explode($separator, $string, $limit = null) { // provide $string default to prevent deprecation errors in PHP >=8.1 return explode($separator, $string ?? '', $limit ?? PHP_INT_MAX); diff --git a/include/smarty/libs/plugins/modifier.number_format.php b/include/smarty/libs/plugins/modifier.number_format.php index 8c612601f..629966e75 100644 --- a/include/smarty/libs/plugins/modifier.number_format.php +++ b/include/smarty/libs/plugins/modifier.number_format.php @@ -19,7 +19,7 @@ * * @return string */ -function smarty_modifier_number_format(?float $num, int $decimals = 0, ?string $decimal_separator = ".", ?string $thousands_separator = ",") +function smarty_modifier_number_format($num, int $decimals = 0, $decimal_separator = ".", $thousands_separator = ",") { // provide $num default to prevent deprecation errors in PHP >=8.1 return number_format($num ?? 0.0, $decimals, $decimal_separator, $thousands_separator); diff --git a/include/smarty/libs/sysplugins/smartycompilerexception.php b/include/smarty/libs/sysplugins/smartycompilerexception.php index 0a0a32351..c7125ac8e 100644 --- a/include/smarty/libs/sysplugins/smartycompilerexception.php +++ b/include/smarty/libs/sysplugins/smartycompilerexception.php @@ -19,8 +19,8 @@ class SmartyCompilerException extends SmartyException public function __construct( string $message = "", int $code = 0, - ?string $filename = null, - ?int $line = null, + $filename = null, + $line = null, Throwable $previous = null ) { parent::__construct($message, $code, $previous);