X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fping.php;h=d26c7341750600fb6db0fd95e4bfbc4f85e863c1;hb=6dcded4129cebf2e492499cd258bf14a6e25eff9;hp=d7472b920a1075bb57150007260e0e3027d1e680;hpb=8c073a34ce472fc8d0385659a222339a5ba4254a;p=quix0rs-gnu-social.git diff --git a/lib/ping.php b/lib/ping.php index d7472b920a..d26c734175 100644 --- a/lib/ping.php +++ b/lib/ping.php @@ -50,8 +50,16 @@ function ping_broadcast_notice($notice) { "User-Agent: Laconica/".LACONICA_VERSION."\r\n", 'content' => $req))); $file = file_get_contents($notify_url, false, $context); + + if ($file === false || mb_strlen($file) == 0) { + common_log(LOG_WARNING, + "XML-RPC empty results for ping ($notify_url, $notice->id) "); + continue; + } + $response = xmlrpc_decode($file); - if (xmlrpc_is_fault($response)) { + + if (is_array($response) && xmlrpc_is_fault($response)) { common_log(LOG_WARNING, "XML-RPC error for ping ($notify_url, $notice->id) ". "$response[faultString] ($response[faultCode])");