Skip to content

Commit

Permalink
fix: hex validation rule (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio authored Sep 28, 2022
1 parent e8b21ad commit 5c2077c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Rules/ValidHex.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 5c2077c

Please sign in to comment.