mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Improvement to Validator::uuid
Properly matches version digit and variant digit, based on RFC4122
This commit is contained in:
parent
58de6702bc
commit
99c41e0af4
1 changed files with 1 additions and 1 deletions
|
@ -776,7 +776,7 @@ class Validation {
|
|||
* @return boolean Success
|
||||
*/
|
||||
public static function uuid($check) {
|
||||
$regex = '/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i';
|
||||
$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}$/';
|
||||
return self::_check($check, $regex);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue