diff options
author | friendica <info@friendica.com> | 2014-07-22 17:17:33 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-07-22 17:17:33 -0700 |
commit | b29f087cdc11bf1bc9fc726cde43361383121835 (patch) | |
tree | 760614ceba0cf6a0e2cae6234405a5f591840659 /include | |
parent | c061cc0955d24c5a452d9ad1c7f207a58f75e728 (diff) | |
download | volse-hubzilla-b29f087cdc11bf1bc9fc726cde43361383121835.tar.gz volse-hubzilla-b29f087cdc11bf1bc9fc726cde43361383121835.tar.bz2 volse-hubzilla-b29f087cdc11bf1bc9fc726cde43361383121835.zip |
provide ability to blacklist sites from "Discover".
Diffstat (limited to 'include')
-rw-r--r-- | include/externals.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/externals.php b/include/externals.php index 1d9fd2902..5ee355c9d 100644 --- a/include/externals.php +++ b/include/externals.php @@ -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']); |