From a73dd0a9f26df59cfb4b68e98d1184ac042c90ea Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Tue, 10 Sep 2019 10:51:34 -0400 Subject: [PATCH] Fix entity-based lookup in html & scriptlet filtering Entity-based filters where not properly looked-up if they used subdomains. Example: - `example.*##^script` => ok - `www.example.*##^script` => failed on `https://www.example.com/` --- src/js/html-filtering.js | 2 +- src/js/scriptlet-filtering.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/html-filtering.js b/src/js/html-filtering.js index 58a23b14e..d1118ba46 100644 --- a/src/js/html-filtering.js +++ b/src/js/html-filtering.js @@ -356,7 +356,7 @@ ); if ( details.entity !== '' ) { filterDB.retrieve( - `${hostname.slice(0, -details.domain)}${details.entity}`, + `${hostname.slice(0, -details.domain.length)}${details.entity}`, [ plains, exceptions, procedurals, exceptions ] ); } diff --git a/src/js/scriptlet-filtering.js b/src/js/scriptlet-filtering.js index 7c2b48903..7477960e4 100644 --- a/src/js/scriptlet-filtering.js +++ b/src/js/scriptlet-filtering.js @@ -369,7 +369,7 @@ ); if ( request.entity !== '' ) { scriptletDB.retrieve( - `${hostname.slice(0, -request.domain)}${request.entity}`, + `${hostname.slice(0, -request.domain.length)}${request.entity}`, [ scriptlets, exceptions ] ); }