Improvement to Validator::uuid

Properly matches version digit and variant digit, based on RFC4122
This commit is contained in:
Sethrin 2013-03-15 04:11:22 -07:00
parent 58de6702bc
commit 99c41e0af4

View file

@ -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);
}