mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-05 12:14:12 +02:00
- changed internals to use Smarty::$_MBSTRING ($_CHARSET, $_DATE_FORMAT) for better unit testing
This commit is contained in:
@@ -23,8 +23,8 @@ function smarty_modifiercompiler_count_characters($params, $compiler)
|
||||
if (!isset($params[1]) || $params[1] != 'true') {
|
||||
return 'preg_match_all(\'/[^\s]/u\',' . $params[0] . ', $tmp)';
|
||||
}
|
||||
if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) {
|
||||
return 'mb_strlen(' . $params[0] . ', SMARTY_RESOURCE_CHAR_SET)';
|
||||
if (Smarty::$_MBSTRING) {
|
||||
return 'mb_strlen(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')';
|
||||
}
|
||||
// no MBString fallback
|
||||
return 'strlen(' . $params[0] . ')';
|
||||
|
||||
Reference in New Issue
Block a user