mirror of
https://github.com/privacy-protection-tools/anti-AD.git
synced 2025-01-22 22:39:16 +08:00
full subdomain supported, for pi-hole. #28
This commit is contained in:
parent
62dc7b9789
commit
481771fd2b
5665
anti-ad-domains.txt
5665
anti-ad-domains.txt
File diff suppressed because it is too large
Load Diff
@ -203,6 +203,7 @@ class addressMaker{
|
||||
|
||||
if((in_array('.' . $rk, $rv) || in_array('www.' . $rk, $rv) || in_array($rk, $rv))
|
||||
&& !array_key_exists($rk, $GLOBALS['arr_whitelist'])
|
||||
&& (1 !== $formatObj['full_domain'])
|
||||
){
|
||||
$write_len += fwrite($fp, str_replace('{DOMAIN}', $rk, $formatObj['format']) . "\n");
|
||||
continue;
|
||||
@ -218,7 +219,7 @@ class addressMaker{
|
||||
$tmp_arr1 = explode('.', $rvv);
|
||||
$written_flag = false;
|
||||
|
||||
if(count($tmp_arr1) > 2){
|
||||
if(count($tmp_arr1) > 2 && (1 !== $formatObj['full_domain'])){
|
||||
for($tmp_pos = 3; $tmp_pos <= count($tmp_arr1); $tmp_pos++){
|
||||
$tmp_arr2 = array_slice($tmp_arr1, -1 * $tmp_pos);
|
||||
if(in_array(implode('.', $tmp_arr2), $rv)){
|
||||
|
@ -12,6 +12,7 @@ class writerFormat{
|
||||
const DNSMASQ = array(
|
||||
'format' => 'address=/{DOMAIN}/',
|
||||
'header' => "#VER={DATE}\n#URL={URL}\n",
|
||||
'full_domain' => 0,
|
||||
'name' => 'dnsmasq',
|
||||
'filename' => 'adblock-for-dnsmasq.conf'
|
||||
);
|
||||
@ -20,6 +21,7 @@ class writerFormat{
|
||||
const EASYLIST = array(
|
||||
'format' => '||{DOMAIN}^',
|
||||
'header' => "!AdBlock-style blocklists\n!VER={DATE}\n!URL={URL}\n",
|
||||
'full_domain' => 0,
|
||||
'name' => 'easylist',
|
||||
'filename' => 'anti-ad-easylist.txt'
|
||||
);
|
||||
@ -28,6 +30,7 @@ class writerFormat{
|
||||
const SURGE = array(
|
||||
'format' => 'DOMAIN-SUFFIX,{DOMAIN}',
|
||||
'header' => "#VER={DATE}\n#URL={URL}\n",
|
||||
'full_domain' => 0,
|
||||
'name' => 'surge',
|
||||
'filename' => 'anti-ad-surge.txt'
|
||||
);
|
||||
@ -36,6 +39,7 @@ class writerFormat{
|
||||
const DOMAINS = array(
|
||||
'format' => '{DOMAIN}',
|
||||
'header' => "#VER={DATE}\n#URL={URL}\n",
|
||||
'full_domain' => 1, //保留子域名,即使其上级域名
|
||||
'name' => 'domains',
|
||||
'filename' => 'anti-ad-domains.txt'
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user