Fix alphaNumeric validation

This commit is contained in:
Yuya Takeyama 2013-03-14 20:10:17 +09:00
parent f1d192f282
commit 14c81fe052
2 changed files with 2 additions and 1 deletions

View file

@ -175,6 +175,7 @@ class ValidationTest extends CakeTestCase {
$this->assertFalse(Validation::alphaNumeric('12 234'));
$this->assertFalse(Validation::alphaNumeric('dfd 234'));
$this->assertFalse(Validation::alphaNumeric("0\n"));
$this->assertFalse(Validation::alphaNumeric("\n"));
$this->assertFalse(Validation::alphaNumeric("\t"));
$this->assertFalse(Validation::alphaNumeric("\r"));

View file

@ -92,7 +92,7 @@ class Validation {
if (empty($check) && $check != '0') {
return false;
}
return self::_check($check, '/^[\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}]+$/mu');
return self::_check($check, '/^[\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}]+$/Du');
}
/**