letting IXR take care of URI parsing, while leaving the old way to call weblog_ping possible

git-svn-id: https://develop.svn.wordpress.org/trunk@1676 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
michelvaldrighi 2004-09-17 08:39:12 +00:00
parent 45d9bf4b56
commit be784a3f52
1 changed files with 2 additions and 3 deletions

View File

@ -493,7 +493,7 @@ function weblog_ping($server = '', $path = '') {
include_once (ABSPATH . WPINC . '/class-IXR.php');
// using a timeout of 3 seconds should be enough to cover slow servers
$client = new IXR_Client($server, (($path == '') ? false : $path));
$client = new IXR_Client($server, ((!strlen(trim($path)) || ('/' == $path)) ? false : $path));
$client->timeout = 3;
$client->useragent .= ' / WordPress '.$wp_version;
@ -510,8 +510,7 @@ function generic_ping($post_id = 0) {
if ('' != $services) {
$services = explode("\n", $services);
foreach ($services as $service) {
$uri = parse_url($service);
weblog_ping($uri['host'], $uri['path']);
weblog_ping($service);
}
}