Permalink
Browse files

Fix alphaNumeric validation

  • Loading branch information...
1 parent f1d192f commit 14c81fe0521e4a1b0f32bf7f6b9936dcfcaf6998 @yuya-takeyama yuya-takeyama committed Mar 14, 2013
Showing with 2 additions and 1 deletion.
  1. +1 −0 lib/Cake/Test/Case/Utility/ValidationTest.php
  2. +1 −1 lib/Cake/Utility/Validation.php
@@ -175,6 +175,7 @@ public function testAlphaNumeric() {
$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"));
@@ -92,7 +92,7 @@ public static function alphaNumeric($check) {
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');
}
/**

0 comments on commit 14c81fe

Please sign in to comment.