From 0994a6243f12c18448ee1efb058158116c75efc9 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 8 Oct 2011 11:15:10 +0000 Subject: [PATCH] another fix for '/foo', '/=foo' and '/unknown=foo' --- source/Ox.UI/js/Core/Ox.URL.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/source/Ox.UI/js/Core/Ox.URL.js b/source/Ox.UI/js/Core/Ox.URL.js index d269749e..6f2892e7 100644 --- a/source/Ox.UI/js/Core/Ox.URL.js +++ b/source/Ox.UI/js/Core/Ox.URL.js @@ -308,16 +308,14 @@ Ox.URL = function(options) { return false; } }); - if (!condition.operator) { - // missing operator - condition = {key: '*', value: condition.value, operator: '='}; - } else if (!condition.key) { - // missing key - condition.key = '*'; - } else if (Ox.getPositionById(self.options.findKeys, condition.key) == -1) { - // unknown key + condition.key = condition.key || '*'; + if ( + !condition.operator + || Ox.getPositionById(self.options.findKeys, condition.key) == -1 + ) { + // missing operator or unknown key condition = {key: '*', value: str, operator: '='}; - } + } if (['=', '!='].indexOf(condition.operator) > -1) { if (condition.value[0] == '*') { condition.value = condition.value.substr(1);