-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-digits allowed in digits_between #42326
Comments
I don't think we're going to change this any time soon, sorry. |
Also see the original issue for that: #40264. This should be a numeric value. Maybe digit isn't an 100% word but the rule atm does what it's suppose to do. |
Ah the multiple dots thing is a concern. I'll send in a PR for that. |
I sent in a PR for this: #42330 |
@driesvints I disagree. Which one is it then – a digit or a numeric?
More arguments:
* In programming, a docblock or DocBlock is a specially formatted comment specified in source code that is used to document a specific segment of code. |
I'm sorry but I'm not going to change my mind over this. Changing this would be a large breaking change for many apps. It's only terminology and it's clearly documented. If you want, you can attempt a PR that adds a rule that does exactly what you want. |
Description:
Meaning of digit: any one of the ten numbers 0 to 9
A dot (
.
) is not a digit.The problem is that the validation rule
digits_between
accepts fractions (a dot), multiple dots and even dots only (....
). 🤣Note that the validation rule
digits
does not accept fractions (that is good) and that makes an inconsistency between these two validation rules.Please, let the digits stay digits! In my opinion, this PR should be rolled back.
I suggest to make a separate and a valid validation rule for fractions. Name it
floats
andfloats_between
, or something like that.This is how validation rule
digits_between
looks like in Laravel v9.11.0 (look atpreg_match
):I found that this validation rule looks like that in these versions: v6.20.44, v8.79.0 (and newer, including v9.x.x)
This was fun. No hard feelings about my presentation of the issue, I hope. 😉
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: