mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 11:49:56 +03:00
fixes #2066 keep Smarty compatible with PHP 7.0
This commit is contained in:
parent
c0e7e9c87f
commit
bf9a48f63d
3 changed files with 4 additions and 4 deletions
|
@ -18,7 +18,7 @@
|
||||||
*
|
*
|
||||||
* @return array
|
* @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
|
// provide $string default to prevent deprecation errors in PHP >=8.1
|
||||||
return explode($separator, $string ?? '', $limit ?? PHP_INT_MAX);
|
return explode($separator, $string ?? '', $limit ?? PHP_INT_MAX);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
* @return string
|
* @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
|
// provide $num default to prevent deprecation errors in PHP >=8.1
|
||||||
return number_format($num ?? 0.0, $decimals, $decimal_separator, $thousands_separator);
|
return number_format($num ?? 0.0, $decimals, $decimal_separator, $thousands_separator);
|
||||||
|
|
|
@ -19,8 +19,8 @@ class SmartyCompilerException extends SmartyException
|
||||||
public function __construct(
|
public function __construct(
|
||||||
string $message = "",
|
string $message = "",
|
||||||
int $code = 0,
|
int $code = 0,
|
||||||
?string $filename = null,
|
$filename = null,
|
||||||
?int $line = null,
|
$line = null,
|
||||||
Throwable $previous = null
|
Throwable $previous = null
|
||||||
) {
|
) {
|
||||||
parent::__construct($message, $code, $previous);
|
parent::__construct($message, $code, $previous);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue