fix #227 (the fork bomb bug)
This commit is contained in:
parent
6a9707ed0b
commit
b9a86e2620
1 changed files with 5 additions and 1 deletions
|
@ -367,7 +367,7 @@ Ox.URL = function(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseFind(str) {
|
function parseFind(str) {
|
||||||
str = str.replace(/%7C/g, '|');
|
str = (str || '').replace(/%7C/g, '|');
|
||||||
var conditions, counter = 0,
|
var conditions, counter = 0,
|
||||||
find = {conditions: [], operator: '&'},
|
find = {conditions: [], operator: '&'},
|
||||||
subconditions = [];
|
subconditions = [];
|
||||||
|
@ -385,6 +385,10 @@ Ox.URL = function(options) {
|
||||||
(++counter == 1) && subconditions.push('');
|
(++counter == 1) && subconditions.push('');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
subconditions = subconditions.filter(function(subcondition) {
|
||||||
|
// make sure empty brackets don't throw errors
|
||||||
|
return !!subcondition;
|
||||||
|
});
|
||||||
subconditions.forEach(function(subcondition, i) {
|
subconditions.forEach(function(subcondition, i) {
|
||||||
str = str.replace(subcondition, i);
|
str = str.replace(subcondition, i);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue