smarty
smarty copied to clipboard
Why strlen modifier not use mb_string?
Why "strlen" modifier not use mb_strlen() instead of strlen() function ?
To have something like :
function smarty_modifier_strlen($string) {
if (function_exists('mb_strlen')) {
return mb_strlen($string);
} else {
return strlen($string);
}
}
I see new StrlenModifierCompiler looks like:
class StrlenModifierCompiler extends Base {
public function compile($params, \Smarty\Compiler\Template $compiler) {
return 'strlen((string) ' . $params[0] . ')';
}
}