mirror of https://github.com/gorhill/uBlock.git
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
|
@ -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('|')}`);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue