From 72de3d420604dd4093704e5ce7cfe707fc41db19 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 6 Jun 2012 12:13:31 +0100 Subject: [PATCH] Fixed problem with prefix filter --- core/modules/wiki.filters.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/modules/wiki.filters.js b/core/modules/wiki.filters.js index e7d8ab7af..162ff62cd 100644 --- a/core/modules/wiki.filters.js +++ b/core/modules/wiki.filters.js @@ -86,12 +86,12 @@ exports.operators = { }, "prefix": { selector: function(operator) { - var op = operator.prefix === "!" ? "!" : ""; - return "for(var title in source) {if(" + op + "title.substr(0,\"" + operator.operand.length + "\")===\"" + $tw.utils.stringify(operator.operand) + "\") {$tw.utils.pushTop(subResults,title);}}"; + var op = operator.prefix === "!" ? "!" : "="; + return "for(var title in source) {if(title.substr(0," + operator.operand.length + ")" + op + "==\"" + $tw.utils.stringify(operator.operand) + "\") {$tw.utils.pushTop(subResults,title);}}"; }, filter: function(operator) { - var op = operator.prefix === "!" ? "" : "!"; - return "for(var r=subResults.length-1; r>=0; r--) {if(" + op + "title.substr(0,\"" + operator.operand.length + "\")===\"" + $tw.utils.stringify(operator.operand) + "\") {subResults.splice(r,1);}}"; + var op = operator.prefix === "!" ? "=" : "!"; + return "for(var r=subResults.length-1; r>=0; r--) {if(title.substr(0," + operator.operand.length + ")" + op + "==\"" + $tw.utils.stringify(operator.operand) + "\") {subResults.splice(r,1);}}"; } }, "is": {