provide ability to blacklist sites from "Discover".
This commit is contained in:
parent
c061cc0955
commit
b29f087cdc
@ -33,8 +33,30 @@ function externals_run($argv, $argc){
|
||||
$url = $r[0]['site_url'];
|
||||
}
|
||||
|
||||
// Note: blacklisted sites must be stored in the config as an array.
|
||||
|
||||
$blacklisted = false;
|
||||
$bl1 = get_config('system','blacklisted_sites');
|
||||
if(is_array($bl1) && $bl1) {
|
||||
foreach($bl1 as $bl) {
|
||||
if(strpos($url,$bl) !== false) {
|
||||
$blacklisted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$attempts ++;
|
||||
|
||||
// make sure we can eventually break out if somebody blacklists all known sites
|
||||
|
||||
if($blacklisted) {
|
||||
if($attempts > 20)
|
||||
break;
|
||||
$attempts --;
|
||||
continue;
|
||||
}
|
||||
|
||||
if($url) {
|
||||
if($r[0]['site_pull'] !== '0000-00-00 00:00:00')
|
||||
$mindate = urlencode($r[0]['site_pull']);
|
||||
|
Reference in New Issue
Block a user