From c7a9befdab53bd8fc5eead41bc72f013ad59db3c Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 30 May 2017 13:04:01 -0400 Subject: [PATCH] fix #2664 --- src/js/reverselookup-worker.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js/reverselookup-worker.js b/src/js/reverselookup-worker.js index a1bf8e4d6..6663fe4ac 100644 --- a/src/js/reverselookup-worker.js +++ b/src/js/reverselookup-worker.js @@ -108,8 +108,13 @@ var fromCosmeticFilter = function(details) { prefix = match[0], filter = details.rawFilter.slice(prefix.length); - var compiled = JSON.stringify(filter), - reFilter = new RegExp('(^|\\n).*?' + reEscape(compiled) + '.*?(\\n|$)', 'g'); + var compiled = JSON.stringify(filter).slice(1, -1), + reFilter = new RegExp( + '(?:^|\\n)[^\\n]*?("|\\")?' + + reEscape(compiled) + + '\\1[^\\n]*?(?:\\n|$)', + 'g' + ); var reHostname = new RegExp( '^' +