Skip to content

Commit

Permalink
Fix regex-like filter representation in logger
Browse files Browse the repository at this point in the history
Related discussion:
- uBlockOrigin/uBlock-issues#805 (comment)

uBO was testing for regex-like plain patterns after
prepending `@@` in the case of exception filters, thus
preventing proper detection of regex-like plain
patterns. The filtering engine was not affected, only
the proper rendering of the filter in the logger was
affected.
  • Loading branch information
gorhill committed Dec 4, 2019
1 parent 082201d commit 34504a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js/static-net-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@ const toLogDataInternal = function(categoryBits, tokenHash, iunit) {
const domains = [];
const logData = { pattern, regex, domains, options, isRegex: false };
filterUnits[iunit].logData(logData);
if ( categoryBits & 0x001 ) {
logData.pattern.unshift('@@');
}
if ( categoryBits & 0x002 ) {
logData.options.unshift('important');
}
Expand All @@ -246,6 +243,9 @@ const toLogDataInternal = function(categoryBits, tokenHash, iunit) {
) {
raw += '*';
}
if ( categoryBits & 0x001 ) {
raw = '@@' + raw;
}
if ( domains.length !== 0 ) {
options.push(`domain=${domains.join('|')}`);
}
Expand Down

0 comments on commit 34504a0

Please sign in to comment.