preparing to use egroupware with mbstring.func_overload=0 by using mb_(strlen|substr) where necessary and providing an implementation for mb_*, if mbstring is not available

This commit is contained in:
Ralf Becker 2014-02-04 09:23:43 +00:00
parent 6fb70805cb
commit 85cd466eda

View File

@ -2318,9 +2318,9 @@ class etemplate_old extends boetemplate
{ {
self::set_validation_error($form_name,lang('Field must not be empty !!!'),''); self::set_validation_error($form_name,lang('Field must not be empty !!!'),'');
} }
if ((int) $attr['maxlength'] > 0 && strlen($value) > (int) $attr['maxlength']) if ((int) $attr['maxlength'] > 0 && mb_strlen($value) > (int) $attr['maxlength'])
{ {
$value = substr($value,0,(int) $attr['maxlength']); $value = mb_substr($value,0,(int) $attr['maxlength']);
} }
if ($attr['preg'] && !preg_match($attr['preg'],$value)) if ($attr['preg'] && !preg_match($attr['preg'],$value))
{ {