Skip to content

Commit

Permalink
netteForms.js: fixed 'Too much recursions' [Closes #143]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 29, 2017
1 parent 215c61c commit 2aed83f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/assets/netteForms.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@
};


var preventFiltering = false;

/**
* Validates single rule.
*/
Expand All @@ -333,8 +335,12 @@
op = op.replace(/\\/g, '');

var arr = Nette.isArray(arg) ? arg.slice(0) : [arg];
for (var i = 0, len = arr.length; i < len; i++) {
arr[i] = Nette.expandRuleArgument(elem.form, arr[i]);
if (!preventFiltering) {
preventFiltering = true;
for (var i = 0, len = arr.length; i < len; i++) {
arr[i] = Nette.expandRuleArgument(elem.form, arr[i]);
}
preventFiltering = false;
}
return Nette.validators[op]
? Nette.validators[op](elem, Nette.isArray(arg) ? arr : arr[0], value.value, value)
Expand Down

0 comments on commit 2aed83f

Please sign in to comment.