fix the url controller '/=foo' and '/unknown=foo' bug again

This commit is contained in:
rlx 2011-10-08 10:47:34 +00:00
parent 7eb73dd4fb
commit fdbcdf975b

View file

@ -308,11 +308,16 @@ Ox.URL = function(options) {
return false;
}
});
if (Ox.getPositionById(self.options.findKeys, condition.key) == -1) {
condition = {key: '*', value: str, operator: '='};
} else if (!condition.operator) {
if (!condition.operator) {
// missing operator
condition = {key: '*', value: condition.value, operator: '='};
}
} else if (
condition.key
&& Ox.getPositionById(self.options.findKeys, condition.key) == -1
) {
// unknown key
condition = {key: '*', value: str, operator: '='};
}
if (['=', '!='].indexOf(condition.operator) > -1) {
if (condition.value[0] == '*') {
condition.value = condition.value.substr(1);