fix: isHexColor doesn't validate correctly #2566
Labels
status: needs triage
Issues which needs to be reproduced to be verified report.
type: fix
Issues describing a broken feature.
Description
By passing the string is
6633FF
that the regex to verify hex color can bypass this validation.I saw the problem that the validate can be pass with the string about from the regex from the source base of this repository validator.js
Minimal code-snippet showcasing the problem
This is the code from validator.js, that maybe the root cause of this validation.
https://github.com/validatorjs/validator.js/blob/master/src/lib/isHexColor.js
I think the regex should be implement like this
Expected behavior
It should validate the string
6633FF
is falseActual behavior
It validate the string
6633FF
is a hex color stringThe text was updated successfully, but these errors were encountered: