[IBAN validator] Fixed and improved handling of lowercase values#10489
Closed
sprain wants to merge 1 commit intosymfony:2.3from
sprain:fix-iban-validator
Closed
[IBAN validator] Fixed and improved handling of lowercase values#10489sprain wants to merge 1 commit intosymfony:2.3from sprain:fix-iban-validator
sprain wants to merge 1 commit intosymfony:2.3from
sprain:fix-iban-validator
Conversation
Contributor
Author
There was a problem hiding this comment.
No reason. Removing it.
Contributor
|
As you said yourself in #10481 (comment) only uppercase letters are valid, so allowing lowercase ones is no option. |
Contributor
Author
|
I understand your point and agree. |
fabpot
added a commit
that referenced
this pull request
Mar 19, 2014
This PR was merged into the 2.3 branch. Discussion ---------- [2.3][Validator] Minor fix in IBAN validator | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #10481, #10489 | License | MIT Added more values to unit tests of IBAN validator to make clear it doesn't accept lower case letters. > Permitted IBAN characters are the digits 0 to 9 and the 26 upper-case Latin alphabetic characters A to Z. http://en.wikipedia.org/wiki/International_Bank_Account_Number Also made little adjustment to code which meant to validate lowercase letters but actually was useless. Commits ------- 3eeb306 Fix IBAN validator
This was referenced Mar 26, 2014
fabpot
added a commit
that referenced
this pull request
Mar 27, 2014
This PR was merged into the 2.5-dev branch. Discussion ---------- [Validator] Improved ISBN validator | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #10386, #10387, #10542 | License | MIT | Doc PR | symfony/symfony-docs/pull/3724 This is a new PR of #10542, now on master branch. Todos: - [x] Discuss and determine deprecation versions - [x] Update docs After following some discussion in the tickets mentioned above I have improved the ISBN validator, which has had some inconsistencies: * Use a `type` which can be set to `isbn10` or `isbn13` or `null` (checks if value matches any type) instead of the current boolean `isbn10` and `isbn13` options which cause confusion (e.q. if both are true, does this mean the value must match any or both? You could think it's the latter, but that's actually impossible.). * In the IBAN validator we recently agreed to be strict about upper- and lowercase handling (#10489). Therefore this should be also the case with the ISBN validator. Some ISBN10 numbers may end with an uppercase `X` (representing the check-digit 10), while a lowercase `x` is considered wrong (see [here](http://www.goodreads.com/topic/show/1253500-a-question-about-isbn-10-s---ending-in-x) and [here](http://en.wikipedia.org/wiki/Category:Pages_with_ISBN_errors)). I did not have access to the actual specifications as I have only found documentation which costs about $100 (e.q. [here](http://www.iso.org/iso/catalogue_detail?csnumber=36563)). To avoid bc breaks I suggest to introduce deprecations for current constraint options. [In the documentation](http://symfony.com/doc/current/contributing/code/conventions.html#deprecations) I haven't found any information about which versions may introduce deprecations, so you might have to help me out here with hints on how to handle it correctly. I'll be happy to provide the code with the deprecated parts removed after that. Commits ------- ec42844 Improved ISBN validator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The IBAN validator didn't correctly handle strings with lowercase letters. It seemed to accept lowercase values as well, but actually didn't.
This PR introduces an
acceptLowercaseoption which on default isfalseto avoid any BC breaks. If you set it to true, IBAN strings containing lowercase letter will also pass if they are otherwise valid.