Skip to content
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

Adds the plus character as a valid option in numeric strings #184

Merged
merged 3 commits into from Mar 6, 2019

Conversation

@Amunak
Copy link
Contributor

Amunak commented Mar 6, 2019

  • bug fix? no
  • new feature? yes
  • BC break? no
  • doc PR: n/a

For whatever reason numeric strings with explicitly positive values (i.e. +1 instead of just 1) have not been considered as valid numerics even though they are perfectly valid (in the sense that even forcibly changing their type to the respective numeric type works as expected).

This PR fixes that issue, adding consistency with PHP and the way numbers can be written to the Validator class.

I have marked this as "not bc breaking" because (1) this use case has not been covered by tests, so it doesn't change any and (2) nobody should accept '-1' as a valid value and expect '+1' to fail.

Please merge this with squash; I accidentally made one too many commits.

Amunak added 3 commits Mar 6, 2019
@Amunak

This comment has been minimized.

Copy link
Contributor Author

Amunak commented Mar 6, 2019

It would appear that your Travis test image is broken.

@dg

This comment has been minimized.

Copy link
Member

dg commented Mar 6, 2019

Thanks

@dg dg merged commit e4d30e5 into nette:master Mar 6, 2019
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
@Amunak Amunak deleted the Amunak:Amunak-patch-1 branch Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.