mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-19 00:49: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:
15
libs/plugins/modifier.implode.php
Normal file
15
libs/plugins/modifier.implode.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Smarty plugin
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage PluginsModifier
|
||||
*/
|
||||
|
||||
function smarty_modifier_implode($values, $separator = '')
|
||||
{
|
||||
if (is_array($separator)) {
|
||||
return implode((string) ($values ?? ''), (array) $separator);
|
||||
}
|
||||
return implode((string) ($separator ?? ''), (array) $values);
|
||||
}
|
||||
Reference in New Issue
Block a user