revert last nonsense changes and fix real issue

This commit is contained in:
Diogo Cordeiro 2018-08-02 07:33:22 +01:00
parent 6a608f08ed
commit 7ce112471d
2 changed files with 3 additions and 3 deletions

View File

@ -139,7 +139,7 @@ class ActivityPubPlugin extends Plugin
} }
try { try {
return Activitypub_notice::create_notice( return Activitypub_notice::create_notice(
ActivityPub_explorer::get_profile_from_url($res->attributedTo), ActivityPub_explorer::get_profile_from_url($res['attributedTo']),
$res->id, $res->id,
$res->url, $res->url,
$res->content, $res->content,

View File

@ -60,7 +60,7 @@ class Activitypub_explorer
$actor_profile = $discovery->lookup($url); $actor_profile = $discovery->lookup($url);
return $actor_profile[0]; return $actor_profile[0];
} catch (Exception $e) { } catch (Exception $e) {
throw new Exception('Invalid Actor: '.$url); throw new Exception('Invalid Actor.');
} }
unset($discovery); unset($discovery);
} }
@ -77,7 +77,7 @@ class Activitypub_explorer
public function lookup($url) public function lookup($url)
{ {
if (in_array($url, ACTIVITYPUB_PUBLIC_TO)) { if (in_array($url, ACTIVITYPUB_PUBLIC_TO)) {
throw new Exception ('Empty Actor URL.'); return [];
} }
common_debug('ActivityPub Explorer: Started now looking for '.$url); common_debug('ActivityPub Explorer: Started now looking for '.$url);