Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Fixed implicit global variable on regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Dec 2, 2015
1 parent 9fcd5f8 commit a194fb7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-validation-ghiscoding",
"version": "1.4.14",
"version": "1.4.15",
"author": "Ghislain B.",
"description": "Angular-Validation Directive and Service (ghiscoding)",
"main": [
Expand Down
6 changes: 3 additions & 3 deletions dist/angular-validation.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-validation-ghiscoding",
"version": "1.4.14",
"version": "1.4.15",
"author": "Ghislain B.",
"description": "Angular-Validation Directive and Service (ghiscoding)",
"main": "app.js",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Angular Validation (Directive / Service)
`Version: 1.4.14`
`Version: 1.4.15`
### Form validation after user stop typing (default 1sec).

Forms Validation with Angular made easy! Angular-Validation is an angular directive/service with locales (languages) with a very simple approach of defining your `validation=""` directly within your element to validate (input, textarea, etc) and...that's it!!! The directive/service will take care of the rest!
Expand Down
5 changes: 2 additions & 3 deletions src/validation-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ angular
var self = this;
var isConditionValid = true;
var isFieldValid = true;
var regex;
var validator;
var validatedObject = {};

Expand Down Expand Up @@ -991,7 +990,7 @@ angular
isWellFormed = true;
}else {
// run the Regex test through each iteration, if required (\S+) and is null then it's invalid automatically
regex = new RegExp(validator.pattern);
var regex = new RegExp(validator.pattern, validator.patternFlag);
isWellFormed = ((!validator.pattern || validator.pattern.toString() === "/\\S+/" || (!!rules && validator.pattern === "required")) && strValue === null) ? false : regex.test(strValue);
}

Expand Down Expand Up @@ -1274,7 +1273,7 @@ angular
isValid = false;
} else {
// run the Regex test through each iteration, if required (\S+) and is null then it's invalid automatically
regex = new RegExp(validator.pattern, validator.patternFlag);
var regex = new RegExp(validator.pattern, validator.patternFlag);
isValid = ((!validator.pattern || validator.pattern.toString() === "/\\S+/" || (!!rules && validator.pattern === "required")) && strValue === null) ? false : regex.test(strValue);
}
}
Expand Down

0 comments on commit a194fb7

Please sign in to comment.