diff --git a/resources/functions.php b/resources/functions.php index 2f740e7c61..e400c726a0 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -106,6 +106,14 @@ //echo uuid(); } + if (!function_exists('is_uuid')) { + function is_uuid($uuid) { + //uuid version 4 + $regex = '/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i'; + return preg_match($regex, $uuid); + } + } + if (!function_exists('recursive_copy')) { function recursive_copy($src,$dst) { $dir = opendir($src);