X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fping.php;h=5698c403875e52b584b80a5fd5f86d8b93a4699f;hb=5581143bee602dbd5417f532f2b483e58d0a4269;hp=175bf8440b61b3f76608b398a2015112b667e424;hpb=73b9e531bf7cab8ba6642f9cb85e4b37b48706d7;p=quix0rs-gnu-social.git diff --git a/lib/ping.php b/lib/ping.php index 175bf8440b..5698c40387 100644 --- a/lib/ping.php +++ b/lib/ping.php @@ -44,20 +44,16 @@ function ping_broadcast_notice($notice) { array('nickname' => $profile->nickname)), $tags)); - $context = stream_context_create(array('http' => array('method' => "POST", - 'header' => - "Content-Type: text/xml\r\n". - "User-Agent: StatusNet/".STATUSNET_VERSION."\r\n", - 'content' => $req))); - $file = file_get_contents($notify_url, false, $context); + $request = HTTPClient::start(); + $httpResponse = $request->post($notify_url, array('Content-Type: text/xml'), $req); - if ($file === false || mb_strlen($file) == 0) { + if (!$httpResponse || mb_strlen($httpResponse->getBody()) == 0) { common_log(LOG_WARNING, "XML-RPC empty results for ping ($notify_url, $notice->id) "); continue; } - $response = xmlrpc_decode($file); + $response = xmlrpc_decode($httpResponse->getBody()); if (is_array($response) && xmlrpc_is_fault($response)) { common_log(LOG_WARNING,