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 3 commits into from Mar 6, 2019

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

merged 3 commits into from Mar 6, 2019


Copy link

@Amunak 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.

Copy link
Contributor Author

@Amunak Amunak commented Mar 6, 2019

It would appear that your Travis test image is broken.

Copy link

@dg dg commented Mar 6, 2019


@dg dg merged commit e4d30e5 into nette:master Mar 6, 2019
1 check failed
@Amunak Amunak deleted the 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
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants