Skip to content

Commit 34504a0

Browse files
committed
Fix regex-like filter representation in logger
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.
1 parent 082201d commit 34504a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/js/static-net-filtering.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,6 @@ const toLogDataInternal = function(categoryBits, tokenHash, iunit) {
223223
const domains = [];
224224
const logData = { pattern, regex, domains, options, isRegex: false };
225225
filterUnits[iunit].logData(logData);
226-
if ( categoryBits & 0x001 ) {
227-
logData.pattern.unshift('@@');
228-
}
229226
if ( categoryBits & 0x002 ) {
230227
logData.options.unshift('important');
231228
}
@@ -246,6 +243,9 @@ const toLogDataInternal = function(categoryBits, tokenHash, iunit) {
246243
) {
247244
raw += '*';
248245
}
246+
if ( categoryBits & 0x001 ) {
247+
raw = '@@' + raw;
248+
}
249249
if ( domains.length !== 0 ) {
250250
options.push(`domain=${domains.join('|')}`);
251251
}

0 commit comments

Comments
 (0)