Skip to content

Commit

Permalink
Removed old references to 'HTTP/Request.php' in pingback and Links pl…
Browse files Browse the repository at this point in the history
…ugin (bug #755)
  • Loading branch information
mystralkk committed Feb 3, 2017
1 parent 6dff2c8 commit 9ac7007
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
27 changes: 14 additions & 13 deletions plugins/links/functions.inc
Expand Up @@ -1312,29 +1312,30 @@ function plugin_getListField_categories($fieldname, $fieldvalue, $A, $icon_arr)
return $retval;
}


/**
* Check if the given URL exists
*
* @param string $url
* @return string
*/
function links_validateUrl($url)
{
global $LANG_LINKS_STATUS;

require_once 'HTTP/Request.php';
$req = new HTTP_Request2($url, HTTP_Request2::METHOD_HEAD);
$req->setHeader('User-Agent', 'Geeklog/' . VERSION);

$retval = '';

$req = new HTTP_Request($url);
$req->setMethod(HTTP_REQUEST_METHOD_HEAD);
$req->addHeader('User-Agent', 'Geeklog/' . VERSION);
try {
$response = $req->send();
$status_code = $response->getStatus();

$response = $req->sendRequest();
if (PEAR::isError($response)) {
$retval = $response->getMessage();
} else {
$status_code = $req->getResponseCode();
if (isset($LANG_LINKS_STATUS[$status_code])) {
$retval = $status_code . ": " . $LANG_LINKS_STATUS[$status_code];
$retval = $status_code . ': ' . $LANG_LINKS_STATUS[$status_code];
} else {
$retval = $LANG_LINKS_STATUS[999];
}
} catch (HTTP_Request2_Exception $e) {
$retval = $e->getMessage();
}

return $retval;
Expand Down
2 changes: 0 additions & 2 deletions public_html/pingback.php
Expand Up @@ -64,8 +64,6 @@ function PNB_handlePingback($id, $type, $url, $oururl)
{
global $_CONF, $_TABLES, $PNB_ERROR;

require_once 'HTTP/Request.php';

if (!isset($_CONF['check_trackback_link'])) {
$_CONF['check_trackback_link'] = 2;
}
Expand Down

0 comments on commit 9ac7007

Please sign in to comment.