mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-19 08:59:30 +01:00
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:
12
libs/plugins/modifiercompiler.substr.php
Normal file
12
libs/plugins/modifiercompiler.substr.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Smarty plugin
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage PluginsModifierCompiler
|
||||
*/
|
||||
function smarty_modifiercompiler_substr($params) {
|
||||
return 'substr((string) ' . $params[0] . ', (int) ' . $params[1] .
|
||||
(isset($params[2]) ? ', (int) ' . $params[2] : '') . ')';
|
||||
}
|
||||
Reference in New Issue
Block a user