Skip to content

Commit

Permalink
Additionals: Update IBAN method, trim trailing whitespaces
Browse files Browse the repository at this point in the history
Fixes gh-970
Closes gh-980
  • Loading branch information
christianhaller authored and jzaefferer committed Jan 15, 2014
1 parent 1a981b4 commit 347b04a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/additional/iban.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ jQuery.validator.addMethod("iban", function(value, element) {
if (this.optional(element)) {
return true;
}
// trim trailing whitespaces
value = jQuery.trim(value);

if (!(/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(value))) {
return false;
}
Expand Down

0 comments on commit 347b04a

Please sign in to comment.