From b29f087cdc11bf1bc9fc726cde43361383121835 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 22 Jul 2014 17:17:33 -0700 Subject: provide ability to blacklist sites from "Discover". --- include/externals.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include/externals.php') 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']); -- cgit v1.2.3 From 1476812e9098e18e266d0fddf4575234f28561f9 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 22 Jul 2014 17:21:13 -0700 Subject: add another important note --- include/externals.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/externals.php') diff --git a/include/externals.php b/include/externals.php index 5ee355c9d..a96bf7c97 100644 --- a/include/externals.php +++ b/include/externals.php @@ -34,6 +34,8 @@ function externals_run($argv, $argc){ } // Note: blacklisted sites must be stored in the config as an array. + // No simple way to turn this into a personal config because we have no identity here. + // For that we probably need a variant of superblock. $blacklisted = false; $bl1 = get_config('system','blacklisted_sites'); -- cgit v1.2.3