From 5c2077c793a509ebfd00c5226ca852e72fff0503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20Ioni=C8=9B=C4=83?= Date: Wed, 28 Sep 2022 10:58:19 +0100 Subject: [PATCH] fix: hex validation rule (#61) --- app/Rules/ValidHex.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Rules/ValidHex.php b/app/Rules/ValidHex.php index 59fafdd2..1d585c5f 100644 --- a/app/Rules/ValidHex.php +++ b/app/Rules/ValidHex.php @@ -17,7 +17,7 @@ class ValidHex implements Rule */ public function passes($attribute, $value) { - return preg_match('/^#[0-9a-f]{3,4,6,8}$/i', $value); + return preg_match('/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i', $value); } /**