mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fixes #5025, UTF8 signs are not treated correctly at form validation
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7320 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
1c2b1ef8eb
commit
d853520e46
2 changed files with 81 additions and 79 deletions
|
@ -139,13 +139,8 @@ class Validation extends Object {
|
|||
if (empty($_this->check) && $_this->check != '0') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$_this->regex = '/[^\\dA-Z]/i';
|
||||
if ($_this->_check() === true) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
$_this->regex = '/^[\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}]+$/mu';
|
||||
return $_this->_check();
|
||||
}
|
||||
/**
|
||||
* Checks that a string length is within s specified range.
|
||||
|
|
|
@ -80,6 +80,13 @@ class ValidationTestCase extends UnitTestCase {
|
|||
$this->assertTrue(Validation::alphaNumeric('12234'));
|
||||
$this->assertTrue(Validation::alphaNumeric('1w2e2r3t4y'));
|
||||
$this->assertTrue(Validation::alphaNumeric('0'));
|
||||
$this->assertTrue(Validation::alphaNumeric('abçďĕʑʘπй'));
|
||||
$this->assertTrue(Validation::alphaNumeric('ˇˆๆゞ'));
|
||||
$this->assertTrue(Validation::alphaNumeric('אกあアꀀ豈'));
|
||||
$this->assertTrue(Validation::alphaNumeric('Džᾈᾨ'));
|
||||
$this->assertTrue(Validation::alphaNumeric('ÆΔΩЖÇ'));
|
||||
|
||||
|
||||
$this->assertFalse(Validation::alphaNumeric('12 234'));
|
||||
$this->assertFalse(Validation::alphaNumeric('dfd 234'));
|
||||
$this->assertFalse(Validation::alphaNumeric("\n"));
|
||||
|
|
Loading…
Add table
Reference in a new issue