X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FLinkbackPlugin.php;h=60f7a60c797f60e80b9914f20a1403eefdeb4aaa;hb=d13a9ae11cac54f13e565ddccb05f2600a272b52;hp=93a0294c4ca9cbd23cd720c4909089b667494136;hpb=1a61a171cdb39444e2c0fbed7cf3a92e0ec271df;p=quix0rs-gnu-social.git diff --git a/plugins/LinkbackPlugin.php b/plugins/LinkbackPlugin.php index 93a0294c4c..60f7a60c79 100644 --- a/plugins/LinkbackPlugin.php +++ b/plugins/LinkbackPlugin.php @@ -1,6 +1,6 @@ . * * @category Plugin - * @package Laconica - * @author Evan Prodromou - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } @@ -42,10 +42,10 @@ define('LINKBACKPLUGIN_VERSION', '0.1'); * are URLs, we test each URL to see if it supports any * * @category Plugin - * @package Laconica - * @author Evan Prodromou + * @package StatusNet + * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see Event */ @@ -75,6 +75,8 @@ class LinkbackPlugin extends Plugin function linkbackUrl($url) { + common_log(LOG_DEBUG,"Attempting linkback for " . $url); + $orig = $url; $url = htmlspecialchars_decode($orig); $scheme = parse_url($url, PHP_URL_SCHEME); @@ -134,15 +136,20 @@ class LinkbackPlugin extends Plugin "User-Agent: " . $this->userAgent(), 'content' => $request))); $file = file_get_contents($endpoint, false, $context); - $response = xmlrpc_decode($file); - if (xmlrpc_is_fault($response)) { + if (!$file) { common_log(LOG_WARNING, + "Pingback request failed for '$url' ($endpoint)"); + } else { + $response = xmlrpc_decode($file); + if (xmlrpc_is_fault($response)) { + common_log(LOG_WARNING, "Pingback error for '$url' ($endpoint): ". "$response[faultString] ($response[faultCode])"); - } else { - common_log(LOG_INFO, + } else { + common_log(LOG_INFO, "Pingback success for '$url' ($endpoint): ". "'$response'"); + } } } @@ -225,6 +232,6 @@ class LinkbackPlugin extends Plugin function userAgent() { return 'LinkbackPlugin/'.LINKBACKPLUGIN_VERSION . - ' Laconica/' . LACONICA_VERSION; + ' StatusNet/' . STATUSNET_VERSION; } }