File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -516,7 +516,11 @@ public static function isUuid($value)
516516 return false ;
517517 }
518518
519- return preg_match ('/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iD ' , $ value ) > 0 ;
519+ if ($ value === '00000000-0000-0000-0000-000000000000 ' ) {
520+ return true ;
521+ }
522+
523+ return preg_match ('/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iD ' , $ value ) > 0 ;
520524 }
521525
522526 /**
Original file line number Diff line number Diff line change @@ -965,6 +965,8 @@ public static function invalidUuidList()
965965 ['af6f8cb-c57d-11e1-9b21-0800200c9a66 ' ],
966966 ['af6f8cb0c57d11e19b210800200c9a66 ' ],
967967 ['ff6f8cb0-c57da-51e1-9b21-0800200c9a66 ' ],
968+ ['ff6f8cb0-c57d-11e1-cb21-0800200c9a66 ' ], // Invalid variant
969+ ['ff6f8cb0-c57d-61e1-9b21-0800200c9a66 ' ], // Invalid version
968970 ];
969971 }
970972
You can’t perform that action at this time.
0 commit comments