mirror of
https://github.com/privacy-protection-tools/anti-AD.git
synced 2025-01-23 06:49:25 +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))
|
if((in_array('.' . $rk, $rv) || in_array('www.' . $rk, $rv) || in_array($rk, $rv))
|
||||||
&& !array_key_exists($rk, $GLOBALS['arr_whitelist'])
|
&& !array_key_exists($rk, $GLOBALS['arr_whitelist'])
|
||||||
|
&& (1 !== $formatObj['full_domain'])
|
||||||
){
|
){
|
||||||
$write_len += fwrite($fp, str_replace('{DOMAIN}', $rk, $formatObj['format']) . "\n");
|
$write_len += fwrite($fp, str_replace('{DOMAIN}', $rk, $formatObj['format']) . "\n");
|
||||||
continue;
|
continue;
|
||||||
@ -218,7 +219,7 @@ class addressMaker{
|
|||||||
$tmp_arr1 = explode('.', $rvv);
|
$tmp_arr1 = explode('.', $rvv);
|
||||||
$written_flag = false;
|
$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++){
|
for($tmp_pos = 3; $tmp_pos <= count($tmp_arr1); $tmp_pos++){
|
||||||
$tmp_arr2 = array_slice($tmp_arr1, -1 * $tmp_pos);
|
$tmp_arr2 = array_slice($tmp_arr1, -1 * $tmp_pos);
|
||||||
if(in_array(implode('.', $tmp_arr2), $rv)){
|
if(in_array(implode('.', $tmp_arr2), $rv)){
|
||||||
|
@ -12,6 +12,7 @@ class writerFormat{
|
|||||||
const DNSMASQ = array(
|
const DNSMASQ = array(
|
||||||
'format' => 'address=/{DOMAIN}/',
|
'format' => 'address=/{DOMAIN}/',
|
||||||
'header' => "#VER={DATE}\n#URL={URL}\n",
|
'header' => "#VER={DATE}\n#URL={URL}\n",
|
||||||
|
'full_domain' => 0,
|
||||||
'name' => 'dnsmasq',
|
'name' => 'dnsmasq',
|
||||||
'filename' => 'adblock-for-dnsmasq.conf'
|
'filename' => 'adblock-for-dnsmasq.conf'
|
||||||
);
|
);
|
||||||
@ -20,6 +21,7 @@ class writerFormat{
|
|||||||
const EASYLIST = array(
|
const EASYLIST = array(
|
||||||
'format' => '||{DOMAIN}^',
|
'format' => '||{DOMAIN}^',
|
||||||
'header' => "!AdBlock-style blocklists\n!VER={DATE}\n!URL={URL}\n",
|
'header' => "!AdBlock-style blocklists\n!VER={DATE}\n!URL={URL}\n",
|
||||||
|
'full_domain' => 0,
|
||||||
'name' => 'easylist',
|
'name' => 'easylist',
|
||||||
'filename' => 'anti-ad-easylist.txt'
|
'filename' => 'anti-ad-easylist.txt'
|
||||||
);
|
);
|
||||||
@ -28,6 +30,7 @@ class writerFormat{
|
|||||||
const SURGE = array(
|
const SURGE = array(
|
||||||
'format' => 'DOMAIN-SUFFIX,{DOMAIN}',
|
'format' => 'DOMAIN-SUFFIX,{DOMAIN}',
|
||||||
'header' => "#VER={DATE}\n#URL={URL}\n",
|
'header' => "#VER={DATE}\n#URL={URL}\n",
|
||||||
|
'full_domain' => 0,
|
||||||
'name' => 'surge',
|
'name' => 'surge',
|
||||||
'filename' => 'anti-ad-surge.txt'
|
'filename' => 'anti-ad-surge.txt'
|
||||||
);
|
);
|
||||||
@ -36,6 +39,7 @@ class writerFormat{
|
|||||||
const DOMAINS = array(
|
const DOMAINS = array(
|
||||||
'format' => '{DOMAIN}',
|
'format' => '{DOMAIN}',
|
||||||
'header' => "#VER={DATE}\n#URL={URL}\n",
|
'header' => "#VER={DATE}\n#URL={URL}\n",
|
||||||
|
'full_domain' => 1, //保留子域名,即使其上级域名
|
||||||
'name' => 'domains',
|
'name' => 'domains',
|
||||||
'filename' => 'anti-ad-domains.txt'
|
'filename' => 'anti-ad-domains.txt'
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user