Respect / Validation

The most awesome validation engine ever created for PHP
https://respect-validation.readthedocs.io
MIT License
5.79k stars 776 forks source link

hexRgbColor() for colors with characters greater than 9 #1320

Closed nixoncode closed 4 years ago

nixoncode commented 4 years ago

Am facing an issue with the rule hexRgbColor

below are samples pulled from the docs and confirmed by my implementation

v::hexRgbColor()->validate('#FFFAAA'); // false
v::hexRgbColor()->validate('#123123'); // true
v::hexRgbColor()->validate('#99999'); // true
v::hexRgbColor()->validate('#ff4081'); // false

anything that has chars A-F is returning false.

environment Version: "respect/validation": "^2.0.17", PHP 7.4.10 (cli) (built: Sep 3 2020 18:21:42) ( NTS ) ProductName: Mac OS X ProductVersion: 10.15.6 BuildVersion: 19G2021

henriquemoody commented 4 years ago

It turns out that the rule is case-sensitive.

I allowed it to be case-insensitive on commit 1809e9f4c49414bafc8fbba3920d8f0e2bc9add8

It will be available on version 2.1

Thanks for reporting! 🐼