mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
parent
04eae1fc24
commit
5aa8a458b1
2 changed files with 2 additions and 1 deletions
|
@ -1924,6 +1924,7 @@ class ValidationTest extends CakeTestCase {
|
|||
}
|
||||
|
||||
public function testUuid() {
|
||||
$this->assertTrue(Validation::uuid('00000000-0000-0000-0000-000000000000'));
|
||||
$this->assertTrue(Validation::uuid('550e8400-e29b-11d4-a716-446655440000'));
|
||||
$this->assertFalse(Validation::uuid('BRAP-e29b-11d4-a716-446655440000'));
|
||||
$this->assertTrue(Validation::uuid('550E8400-e29b-11D4-A716-446655440000'));
|
||||
|
|
|
@ -797,7 +797,7 @@ class Validation {
|
|||
* @return boolean Success
|
||||
*/
|
||||
public static function uuid($check) {
|
||||
$regex = '/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89aAbB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$/';
|
||||
$regex = '/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[0-5][a-fA-F0-9]{3}-[089aAbB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$/';
|
||||
return self::_check($check, $regex);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue