From fdbcdf975b1985ba253a3c194b0b7f1899e5da2a Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 8 Oct 2011 10:47:34 +0000 Subject: [PATCH] fix the url controller '/=foo' and '/unknown=foo' bug again --- source/Ox.UI/js/Core/Ox.URL.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Core/Ox.URL.js b/source/Ox.UI/js/Core/Ox.URL.js index ff3b4591..06a6a37d 100644 --- a/source/Ox.UI/js/Core/Ox.URL.js +++ b/source/Ox.UI/js/Core/Ox.URL.js @@ -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);