diff --git a/source/Ox.UI/js/Core/URL.js b/source/Ox.UI/js/Core/URL.js index e32b0db7..cce6b91c 100644 --- a/source/Ox.UI/js/Core/URL.js +++ b/source/Ox.UI/js/Core/URL.js @@ -663,8 +663,12 @@ Ox.URL = function(options) { function parseFind(str) { str = (str || '').replace(/%7C/g, '|'); - var conditions, counter = 0, + var counter = 0, find = {conditions: [], operator: '&'}, + salt = Ox.range(16).map(function() { + return Ox.char(65 + Ox.random(26)); + }).join(''), + regexp = new RegExp(salt + '(\\d+)'), subconditions = []; if (str.length) { // replace subconditions with placeholder, @@ -685,18 +689,16 @@ Ox.URL = function(options) { return !!subcondition; }); subconditions.forEach(function(subcondition, i) { - str = str.replace(subcondition, i); + str = str.replace(subcondition, salt + i); }); find.operator = str.indexOf('|') > -1 ? '|' : '&' find.conditions = str.split(find.operator).map(function(condition, i) { - var ret; - if (condition[0] == '(') { - // re-insert subcondition - ret = parseFind(subconditions[parseInt(condition.slice(1, -1))]); - } else { - ret = parseCondition(condition); - } - return ret; + condition = condition.replace(regexp, function(match) { + return subconditions[parseInt(arguments[1])]; + }); + return condition[0] == '(' + ? parseFind(condition.slice(1, -1)) + : parseCondition(condition); }); } return find;