From 99c41e0af4d864c5a13a46659f52f9db90b97ad0 Mon Sep 17 00:00:00 2001 From: Sethrin Date: Fri, 15 Mar 2013 04:11:22 -0700 Subject: [PATCH] Improvement to Validator::uuid Properly matches version digit and variant digit, based on RFC4122 --- lib/Cake/Utility/Validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Utility/Validation.php b/lib/Cake/Utility/Validation.php index 43347e37d..d5c8a6029 100644 --- a/lib/Cake/Utility/Validation.php +++ b/lib/Cake/Utility/Validation.php @@ -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); }