diff --git a/public_html/conf/LSobjects/config.LSobjects.LSpeople.php b/public_html/conf/LSobjects/config.LSobjects.LSpeople.php index 0bd81f17..794aac43 100644 --- a/public_html/conf/LSobjects/config.LSobjects.LSpeople.php +++ b/public_html/conf/LSobjects/config.LSobjects.LSpeople.php @@ -234,9 +234,10 @@ $GLOBALS['LSobjects']['LSpeople'] = array ( 'required' => 1, 'default_value' => 'toto', 'check_data' => array ( - 'alphanumeric' => array( - 'msg' => 'The first name must contain alphanumeric values only.' - ), + 'alphanumeric' => array( + 'params' => array('with_accents' => true), + 'msg' => 'The first name must contain alphanumeric values only.' + ), ), 'rights' => array( 'self' => 'r', diff --git a/public_html/includes/class/class.LSformRule_alphanumeric.php b/public_html/includes/class/class.LSformRule_alphanumeric.php index 03f8516a..02fc358f 100644 --- a/public_html/includes/class/class.LSformRule_alphanumeric.php +++ b/public_html/includes/class/class.LSformRule_alphanumeric.php @@ -37,9 +37,17 @@ class LSformRule_alphanumeric extends LSformRule { * @return boolean true si la valeur est valide, false sinon */ function validate ($value,$options=array(),$formElement) { - $regex = '/^[a-zA-Z0-9]+$/'; - LSsession :: loadLSclass('LSformRule_regex'); - return LSformRule_regex :: validate($value,$regex,$formElement); + + + if (isset($options['params']['with_accents']) && $options['params']['with_accents'] == true){ + $regex = '/^[a-zA-Z0-9àâäéèêëîïôöù]+$/'; + } + else { + $regex = '/^[a-zA-Z0-9]+$/'; + } + LSsession :: loadLSclass('LSformRule_regex'); + return LSformRule_regex :: validate($value,$regex,$formElement); + } }