issue #2405 update smarty

and made Piwigo compatible with smarty 5.x
This commit is contained in:
Linty
2025-09-17 12:05:48 +02:00
parent 46837567cb
commit 1be0527523
378 changed files with 24680 additions and 28506 deletions
@@ -0,0 +1,35 @@
<?php
namespace Smarty\Extension;
use Smarty\Exception;
class CallbackWrapper {
/**
* @var callback
*/
private $callback;
/**
* @var string
*/
private $modifierName;
/**
* @param string $modifierName
* @param callback $callback
*/
public function __construct(string $modifierName, $callback) {
$this->callback = $callback;
$this->modifierName = $modifierName;
}
public function handle(...$params) {
try {
return ($this->callback)(...$params);
} catch (\ArgumentCountError $e) {
throw new Exception("Invalid number of arguments to modifier " . $this->modifierName);
}
}
}