support zot location independent urls

This commit is contained in:
zotlabs
2019-02-18 18:16:50 -08:00
parent b5109d2a1a
commit 175f78fa84
4 changed files with 320 additions and 22 deletions

View File

@@ -263,24 +263,8 @@ class ActivityStreams {
return self::fetch($url);
}
static function fetch($url) {
$redirects = 0;
if(! check_siteallowed($url)) {
logger('blacklisted: ' . $url);
return null;
}
logger('fetch: ' . $url, LOGGER_DEBUG);
$x = z_fetch_url($url, true, $redirects,
[ 'headers' => [ 'Accept: application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"' ]]);
if($x['success']) {
$y = json_decode($x['body'],true);
logger('returned: ' . json_encode($y,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));
return json_decode($x['body'], true);
}
else {
logger('fetch failed: ' . $url);
}
return null;
static function fetch($url,$channel = null) {
return Activity::fetch($url,$channel);
}
static function is_an_actor($s) {