Some bug fixes for Avatar Grabber

Replace Exceptions for I/O msg on remote notice validation
This commit is contained in:
Diogo Cordeiro
2018-08-02 05:54:27 +01:00
parent 5f979a32f9
commit 0384890f7b
6 changed files with 39 additions and 28 deletions

View File

@@ -121,11 +121,9 @@ class ActivityPubPlugin extends Plugin
$response = $client->get($url, $headers);
$res = json_decode($response->getBody(), true);
$settings = [];
try {
Activitypub_notice::validate_remote_notice($res);
} catch (Exception $e) {
if (!Activitypub_notice::validate_remote_notice($res, $msg)) {
common_debug('ActivityPubPlugin Notice Grabber: Invalid potential remote notice while processing id: '.$url. '. He returned the following: '.json_encode($res, JSON_UNESCAPED_SLASHES));
throw $e;
throw new Exception($msg);
}
if (isset($res->inReplyTo)) {