Merge pull request #1177 from yuya-takeyama/fix-alphaNumeric-validation

Fix alphaNumeric validation
This commit is contained in:
Mark Story 2013-03-14 07:23:51 -07:00
commit 60f9131940
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');
}
/**