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

Commit a194fb7

Browse files
committed
Fixed implicit global variable on regex
1 parent 9fcd5f8 commit a194fb7

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.4.14",
3+
"version": "1.4.15",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": [

dist/angular-validation.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.4.14",
3+
"version": "1.4.15",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": "app.js",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Angular Validation (Directive / Service)
2-
`Version: 1.4.14`
2+
`Version: 1.4.15`
33
### Form validation after user stop typing (default 1sec).
44

55
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!

src/validation-common.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ angular
497497
var self = this;
498498
var isConditionValid = true;
499499
var isFieldValid = true;
500-
var regex;
501500
var validator;
502501
var validatedObject = {};
503502

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

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

0 commit comments

Comments
 (0)