From 811ccf0f102ce4b82efa2136a387e4c9e6b94456 Mon Sep 17 00:00:00 2001 From: IgnatzHome Date: Sat, 19 May 2018 21:31:43 +0200 Subject: i was constructing the wrong and the whole time.. *sigh* --- client/lib/filter.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/lib/filter.js b/client/lib/filter.js index bab04d48..854ff446 100644 --- a/client/lib/filter.js +++ b/client/lib/filter.js @@ -108,6 +108,7 @@ class AdvancedFilter { const commands = []; let current = ''; let string = false; + let wasString = false; let ignore = false; for (let i = 0; i < this._filter.length; i++) { @@ -120,6 +121,7 @@ class AdvancedFilter { if (char === '\'') { string = !string; + if (string) wasString = true; continue; } if (char === '\\') @@ -129,7 +131,8 @@ class AdvancedFilter { } if (char === ' ' && !string) { - commands.push({'cmd':current, string}); + commands.push({'cmd':current, 'string':wasString}); + wasString = false; current = ''; continue; } @@ -137,7 +140,7 @@ class AdvancedFilter { } if (current !== '') { - commands.push(current); + commands.push({'cmd':current, 'string':wasString}); } return commands; } -- cgit v1.2.3-1-g7c22