make sure queries that both start and end with '*' are not interpreted as starts/ends with
This commit is contained in:
parent
0378c58d26
commit
ed127b0259
1 changed files with 3 additions and 6 deletions
|
@ -627,14 +627,11 @@ Ox.URL = function(options) {
|
||||||
// missing operator or unknown key
|
// missing operator or unknown key
|
||||||
condition = {key: '*', value: str, operator: '='};
|
condition = {key: '*', value: str, operator: '='};
|
||||||
}
|
}
|
||||||
if (
|
if (['=', '!='].indexOf(condition.operator) > -1) {
|
||||||
['=', '!='].indexOf(condition.operator) > -1
|
if (Ox.startsWith(condition.value, '*') && !Ox.endsWith(condition.value, '*')) {
|
||||||
&& condition.value != '*'
|
|
||||||
) {
|
|
||||||
if (condition.value[0] == '*') {
|
|
||||||
condition.value = condition.value.slice(1);
|
condition.value = condition.value.slice(1);
|
||||||
condition.operator = condition.operator.replace('=', '$')
|
condition.operator = condition.operator.replace('=', '$')
|
||||||
} else if (condition.value[condition.value.length - 1] == '*') {
|
} else if (Ox.endsWith(condition.value, '*') && !Ox.startsWith(condition.value, '*')) {
|
||||||
condition.value = condition.value.slice(0, -1);
|
condition.value = condition.value.slice(0, -1);
|
||||||
condition.operator = condition.operator.replace('=', '^')
|
condition.operator = condition.operator.replace('=', '^')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue