Prevent deprecation notices for implode, json_encode and substr modifiers

* Prevent deprecation notices for implode, json_encode and substr modifiers.
* unit tests
This commit is contained in:
Simon Wisselink
2024-02-26 14:33:47 +01:00
committed by GitHub
parent 326b2da8da
commit de1bc77f7f
7 changed files with 209 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
function smarty_modifiercompiler_json_encode($params) {
return 'json_encode(' . $params[0] . (isset($params[1]) ? ', (int) ' . $params[1] : '') . ')';
}