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
1 changed files with 3 additions and 3 deletions

View File

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