diff options
author | friendica <info@friendica.com> | 2014-08-21 21:07:32 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-08-21 21:07:32 -0700 |
commit | 69d3e5468d970633412cbdc731a4e477181dbc8c (patch) | |
tree | 2f870d9951caf15b795cb3aa6ee9b50e5d79b8ba /include/diaspora.php | |
parent | 72a766432d90f6eec44641466e77567808f61aca (diff) | |
download | volse-hubzilla-69d3e5468d970633412cbdc731a4e477181dbc8c.tar.gz volse-hubzilla-69d3e5468d970633412cbdc731a4e477181dbc8c.tar.bz2 volse-hubzilla-69d3e5468d970633412cbdc731a4e477181dbc8c.zip |
provide the site blacklist everywhere it is needed
Diffstat (limited to 'include/diaspora.php')
-rwxr-xr-x | include/diaspora.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/diaspora.php b/include/diaspora.php index dda552536..2010b1494 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -106,6 +106,26 @@ function diaspora_dispatch($importer,$msg,$attempt=1) { return $ret; } + +function diaspora_is_blacklisted($s) { + + $bl1 = get_config('system','blacklisted_sites'); + if(is_array($bl1) && $bl1) { + foreach($bl1 as $bl) { + if($bl && strpos($s,$bl) !== false) { + logger('diaspora_is_blacklisted: blacklisted ' . $s); + return true; + } + } + } + return false; +} + + + + + + function diaspora_handle_from_contact($contact_id) { $handle = false; @@ -122,6 +142,10 @@ function diaspora_handle_from_contact($contact_id) { } function diaspora_get_contact_by_handle($uid,$handle) { + + if(diaspora_is_blacklisted($handle)) + return false; + $r = q("SELECT * FROM abook left join xchan on xchan_hash = abook_xchan where xchan_addr = '%s' and abook_channel = %d limit 1", dbesc($handle), intval($uid) @@ -140,6 +164,8 @@ function find_diaspora_person_by_handle($handle) { $endlessloop = 0; $maxloops = 10; + if(diaspora_is_blacklisted($handle)) + return false; $r = q("select * from xchan where xchan_addr = '%s' limit 1", dbesc($handle) |