- added Smarty::$_UTF8_MODIFIER for proper PCRE charset handling (Forum Topic 20452)

This commit is contained in:
rodneyrehm
2011-12-18 18:48:07 +00:00
14 changed files with 42 additions and 22 deletions
@@ -21,7 +21,7 @@
function smarty_modifiercompiler_count_characters($params, $compiler)
{
if (!isset($params[1]) || $params[1] != 'true') {
return 'preg_match_all(\'/[^\s]/u\',' . $params[0] . ', $tmp)';
return 'preg_match_all(\'/[^\s]/' . Smarty::$_UTF8_MODIFIER . '\',' . $params[0] . ', $tmp)';
}
if (Smarty::$_MBSTRING) {
return 'mb_strlen(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')';