diff --git a/extensions/tags/src/TagValidator.php b/extensions/tags/src/TagValidator.php index d4cdbb435..cf1d9c528 100644 --- a/extensions/tags/src/TagValidator.php +++ b/extensions/tags/src/TagValidator.php @@ -18,6 +18,6 @@ class TagValidator extends AbstractValidator 'slug' => ['required', 'unique:tags', 'regex:/^[^\/\\ ]*$/i'], 'is_hidden' => ['bool'], 'description' => ['string', 'max:700'], - 'color' => ['regex:/^#([a-f0-9]{6}|[a-f0-9]{3})$/i'], + 'color' => ['hex_color'], ]; } diff --git a/framework/core/locale/validation.yml b/framework/core/locale/validation.yml index 934d1739d..7c2b40189 100644 --- a/framework/core/locale/validation.yml +++ b/framework/core/locale/validation.yml @@ -41,6 +41,7 @@ validation: file: "The :attribute must be greater than or equal :value kilobytes." string: "The :attribute must be greater than or equal :value characters." array: "The :attribute must have :value items or more." + hex_color: "The :attribute field must be a valid hexadecimal color." image: "The :attribute must be an image." in: "The selected :attribute is invalid." in_array: "The :attribute field does not exist in :other."