1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-05 18:32:30 +01:00

Fix regex-like filter representation in logger

Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/805#issuecomment-561500819

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.
This commit is contained in:
Raymond Hill 2019-12-04 10:42:03 -05:00
parent 082201d24a
commit 34504a0a1a
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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');
}
@ -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('|')}`);
}