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) {
|
||||
str = str.replace(/%7C/g, '|');
|
||||
str = (str || '').replace(/%7C/g, '|');
|
||||
var conditions, counter = 0,
|
||||
find = {conditions: [], operator: '&'},
|
||||
subconditions = [];
|
||||
|
@ -385,6 +385,10 @@ Ox.URL = function(options) {
|
|||
(++counter == 1) && subconditions.push('');
|
||||
}
|
||||
});
|
||||
subconditions = subconditions.filter(function(subcondition) {
|
||||
// make sure empty brackets don't throw errors
|
||||
return !!subcondition;
|
||||
});
|
||||
subconditions.forEach(function(subcondition, i) {
|
||||
str = str.replace(subcondition, i);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue