mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 17:41:03 +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:
parent
082201d24a
commit
34504a0a1a
1 changed files with 3 additions and 3 deletions
|
@ -223,9 +223,6 @@ const toLogDataInternal = function(categoryBits, tokenHash, iunit) {
|
||||||
const domains = [];
|
const domains = [];
|
||||||
const logData = { pattern, regex, domains, options, isRegex: false };
|
const logData = { pattern, regex, domains, options, isRegex: false };
|
||||||
filterUnits[iunit].logData(logData);
|
filterUnits[iunit].logData(logData);
|
||||||
if ( categoryBits & 0x001 ) {
|
|
||||||
logData.pattern.unshift('@@');
|
|
||||||
}
|
|
||||||
if ( categoryBits & 0x002 ) {
|
if ( categoryBits & 0x002 ) {
|
||||||
logData.options.unshift('important');
|
logData.options.unshift('important');
|
||||||
}
|
}
|
||||||
|
@ -246,6 +243,9 @@ const toLogDataInternal = function(categoryBits, tokenHash, iunit) {
|
||||||
) {
|
) {
|
||||||
raw += '*';
|
raw += '*';
|
||||||
}
|
}
|
||||||
|
if ( categoryBits & 0x001 ) {
|
||||||
|
raw = '@@' + raw;
|
||||||
|
}
|
||||||
if ( domains.length !== 0 ) {
|
if ( domains.length !== 0 ) {
|
||||||
options.push(`domain=${domains.join('|')}`);
|
options.push(`domain=${domains.join('|')}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue