X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FLinkback%2FLinkbackPlugin.php;h=06c49b0809ae90baa503e02eec304d32f0d3ffdb;hb=722ff4d9c0cc47b5dda181136e03166eae712e87;hp=941e7c4c4b9241705c02dbddefb3e35586973bfe;hpb=95d415257a43d5d4338ce22089463c1820b6bf8b;p=quix0rs-gnu-social.git diff --git a/plugins/Linkback/LinkbackPlugin.php b/plugins/Linkback/LinkbackPlugin.php index 941e7c4c4b..06c49b0809 100644 --- a/plugins/Linkback/LinkbackPlugin.php +++ b/plugins/Linkback/LinkbackPlugin.php @@ -79,11 +79,17 @@ class LinkbackPlugin extends Plugin $repeat = Notice::getByID($notice->repeat_of); $this->linkbackUrl($repeat->getUrl()); } else if(!empty($notice->reply_to)) { - $parent = $notice->getParent(); - $this->linkbackUrl($parent->getUrl()); + try { + $parent = $notice->getParent(); + $this->linkbackUrl($parent->getUrl()); + } catch (NoParentNoticeException $e) { + // can't link back to what we don't know (apparently parent notice disappeared from our db) + return true; + } } - $replyProfiles = Profile::multiGet('id', $notice->getReplies()); + // doubling up getReplies and getAttentionProfileIDs because we're not entirely migrated yet + $replyProfiles = Profile::multiGet('id', array_unique(array_merge($notice->getReplies(), $notice->getAttentionProfileIDs()))); foreach($replyProfiles->fetchAll('profileurl') as $profileurl) { $this->linkbackUrl($profileurl); } @@ -182,9 +188,8 @@ class LinkbackPlugin extends Plugin common_log(LOG_WARNING, "Webmention request failed for '$url' ($endpoint)"); } - } catch (HTTP_Request2_Exception $e) { - common_log(LOG_WARNING, - "Webmention request failed for '$url' ($endpoint)"); + } catch (Exception $e) { + common_log(LOG_WARNING, "Webmention request failed for '{$url}' ({$endpoint}): {$e->getMessage()}"); } } @@ -224,9 +229,8 @@ class LinkbackPlugin extends Plugin "Pingback success for '$url' ($endpoint): ". "'$response'"); } - } catch (HTTP_Request2_Exception $e) { - common_log(LOG_WARNING, - "Pingback request failed for '$url' ($endpoint)"); + } catch (Exception $e) { + common_log(LOG_WARNING, "Pingback request failed for '{$url}' ({$endpoint}): {$e->getMessage()}"); } } @@ -333,7 +337,7 @@ class LinkbackPlugin extends Plugin $versions[] = array('name' => 'Linkback', 'version' => LINKBACKPLUGIN_VERSION, 'author' => 'Evan Prodromou', - 'homepage' => 'http://status.net/wiki/Plugin:Linkback', + 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Linkback', 'rawdescription' => // TRANS: Plugin description. _m('Notify blog authors when their posts have been linked in '.