mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fix alphaNumeric validation
This commit is contained in:
parent
f1d192f282
commit
14c81fe052
2 changed files with 2 additions and 1 deletions
|
@ -175,6 +175,7 @@ class ValidationTest extends CakeTestCase {
|
||||||
|
|
||||||
$this->assertFalse(Validation::alphaNumeric('12 234'));
|
$this->assertFalse(Validation::alphaNumeric('12 234'));
|
||||||
$this->assertFalse(Validation::alphaNumeric('dfd 234'));
|
$this->assertFalse(Validation::alphaNumeric('dfd 234'));
|
||||||
|
$this->assertFalse(Validation::alphaNumeric("0\n"));
|
||||||
$this->assertFalse(Validation::alphaNumeric("\n"));
|
$this->assertFalse(Validation::alphaNumeric("\n"));
|
||||||
$this->assertFalse(Validation::alphaNumeric("\t"));
|
$this->assertFalse(Validation::alphaNumeric("\t"));
|
||||||
$this->assertFalse(Validation::alphaNumeric("\r"));
|
$this->assertFalse(Validation::alphaNumeric("\r"));
|
||||||
|
|
|
@ -92,7 +92,7 @@ class Validation {
|
||||||
if (empty($check) && $check != '0') {
|
if (empty($check) && $check != '0') {
|
||||||
return false;
|
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');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue