From b8193ea5f9f65a61187543945fe3d843756efd9c Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Tue, 7 Nov 2023 17:27:37 -0500 Subject: [PATCH] Fix detection of unfilled filter list fields Related feedback: https://github.com/uBlockOrigin/uBlock-discussions/discussions/781#discussioncomment-7503866 --- src/js/assets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/assets.js b/src/js/assets.js index 0ac203b86..6e0eb9560 100644 --- a/src/js/assets.js +++ b/src/js/assets.js @@ -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; }; /******************************************************************************/