From 302c5afdeed2dbb7502a1dd79e269a3082d5eb18 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 29 Nov 2015 16:28:35 -0800 Subject: don't try to pull public content from dead sites --- include/externals.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/externals.php') diff --git a/include/externals.php b/include/externals.php index 18c034bb2..4ac9754e2 100644 --- a/include/externals.php +++ b/include/externals.php @@ -28,7 +28,10 @@ function externals_run($argv, $argc){ } else { $randfunc = db_getfunc('RAND'); - $r = q("select site_url, site_pull from site where site_url != '%s' and site_flags != %d and site_type = %d order by $randfunc limit 1", + + // fixme this query does not deal with directory realms. + + $r = q("select site_url, site_pull from site where site_url != '%s' and site_flags != %d and site_type = %d and site_dead = 0 order by $randfunc limit 1", dbesc(z_root()), intval(DIRECTORY_MODE_STANDALONE), intval(SITE_TYPE_ZOT) -- cgit v1.2.3 From 650f882265cc0256fa85046baacca9dc6db56d24 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 29 Nov 2015 20:26:00 -0800 Subject: generalise the site black|white allow lists, also add a channel black|white list for future use --- include/externals.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'include/externals.php') diff --git a/include/externals.php b/include/externals.php index 4ac9754e2..3a3a32420 100644 --- a/include/externals.php +++ b/include/externals.php @@ -40,19 +40,11 @@ function externals_run($argv, $argc){ $url = $r[0]['site_url']; } - // 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'); - if(is_array($bl1) && $bl1) { - foreach($bl1 as $bl) { - if($bl && strpos($url,$bl) !== false) { - $blacklisted = true; - break; - } - } + + if(! check_siteallowed($url)) { + logger('blacklisted site: ' . $url); + $blacklisted = true; } $attempts ++; -- cgit v1.2.3