Skip to content

Commit

Permalink
Merge pull request #53 from HSLdevcom/postalvalidation
Browse files Browse the repository at this point in the history
Validate postal code properly
  • Loading branch information
siren authored Sep 14, 2017
2 parents ff1e5e1 + dc601b2 commit 2c0b230
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sanitizer/_text_addressit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ if (api && api.localization) {
filteredRegions = api.localization.filteredRegions;
cleanRegions = api.localization.cleanRegions;
if(api.localization.postalCodeValidator) {
var regexp = new RegExp(api.localization.postalCodeValidator);
var postalRegexp = new RegExp(api.localization.postalCodeValidator);
postalCodeValidator = function(code) {
return regexp.test(code);
return postalRegexp.test(code);
};
}
if(api.localization.streetNumberValidator) {
var regexp = new RegExp(api.localization.streetNumberValidator);
var streetNRegexp = new RegExp(api.localization.streetNumberValidator);
streetNumberValidator = function(code) {
return regexp.test(code);
return streetNRegexp.test(code);
};
}
}
Expand Down

0 comments on commit 2c0b230

Please sign in to comment.