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

View File

@@ -0,0 +1,21 @@
<?php
namespace Smarty\Compile\Modifier;
/**
* Smarty count_characters modifier plugin
* Type: modifier
* Name: count_characters
* Purpose: count the number of characters in a text
*
* @author Uwe Tews
*/
class CountCharactersModifierCompiler extends Base {
public function compile($params, \Smarty\Compiler\Template $compiler) {
if (!isset($params[ 1 ]) || $params[ 1 ] !== 'true') {
return 'preg_match_all(\'/[^\s]/' . \Smarty\Smarty::$_UTF8_MODIFIER . '\',' . $params[ 0 ] . ', $tmp)';
}
return 'mb_strlen((string) ' . $params[ 0 ] . ', \'' . addslashes(\Smarty\Smarty::$_CHARSET) . '\')';
}
}