1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-04 16:47:15 +02:00

Fix detection of unfilled filter list fields

Related feedback:
https://github.com/uBlockOrigin/uBlock-discussions/discussions/781#discussioncomment-7503866
This commit is contained in:
Raymond Hill 2023-11-07 17:27:37 -05:00
parent cd430386f5
commit b8193ea5f9
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -68,7 +68,7 @@ const extractMetadataFromList = (content, fields) => {
const re = new RegExp(`^(?:! *|# +)${field.replace(/-/g, '(?: +|-)')}: *(.+)$`, 'im');
const match = re.exec(head);
let value = match && match[1].trim() || undefined;
if ( value !== undefined && /^%.+%$/.test(value) ) {
if ( value !== undefined && value.startsWith('%') ) {
value = undefined;
}
field = field.toLowerCase().replace(
@ -169,7 +169,7 @@ const isDiffUpdatableAsset = content => {
'Diff-Path',
]);
return typeof data.diffPath === 'string' &&
/^[^%].*[^%]$/.test(data.diffPath);
data.diffPath.startsWith('%') === false;
};
/******************************************************************************/