Closed MkQtS closed 1 year ago
在easylist的语法中,形如||example.com^$~image表示拦截来自example.com的所有连接除非是image类型,也就是放行来自example.com的image。那么anti-ad作为域名级的拦截列表应该放过example.com。
||example.com^$~image
example.com
image
原脚本中的正则判断:
if(preg_match('/^\|\|([0-9a-z\-\.]+[a-z]+)\^(\$([^=]+?,)?(image|third-party|script)(,[^=]+)?)?$/', $line, $matches))
没有涉及到~这一字符。||example.com^$~image,script^这类上游规则符合此处判断条件,其中的域名会被anti-ad拦截。实际上已有这样的例子,比如目前||bestcontactform.com^$~image,third-party中的bestcontactform.com,||70e.com^$third-party,~script中的70e.com被拦截了。
~
||example.com^$~image,script^
||bestcontactform.com^$~image,third-party
bestcontactform.com
||70e.com^$third-party,~script
70e.com
这一PR能修复此问题。
在easylist的语法中,形如
||example.com^$~image
表示拦截来自example.com
的所有连接除非是image
类型,也就是放行来自example.com
的image
。那么anti-ad作为域名级的拦截列表应该放过example.com
。原脚本中的正则判断:
没有涉及到
~
这一字符。||example.com^$~image,script^
这类上游规则符合此处判断条件,其中的域名会被anti-ad拦截。实际上已有这样的例子,比如目前||bestcontactform.com^$~image,third-party
中的bestcontactform.com
,||70e.com^$third-party,~script
中的70e.com
被拦截了。这一PR能修复此问题。