Don't try to ping empty sets.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
40671953a0
commit
5e3f6d89a5
|
@ -571,7 +571,6 @@ function weblog_ping($server = '', $path = '') {
|
||||||
new xmlrpcval(get_settings('blog_url') ,'string')));
|
new xmlrpcval(get_settings('blog_url') ,'string')));
|
||||||
$c = new xmlrpc_client($path, $server, 80);
|
$c = new xmlrpc_client($path, $server, 80);
|
||||||
$r = $c->send($f);
|
$r = $c->send($f);
|
||||||
if (!$r) { die("send failed"); }
|
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
print "<h3>Response Object Dump:</h3>\n";
|
print "<h3>Response Object Dump:</h3>\n";
|
||||||
|
@ -600,11 +599,13 @@ function weblog_ping($server = '', $path = '') {
|
||||||
function generic_ping($post_id = 0) {
|
function generic_ping($post_id = 0) {
|
||||||
$services = get_settings('ping_sites');
|
$services = get_settings('ping_sites');
|
||||||
$services = preg_replace("|(\s)+|", '$1', $services); // Kill dupe lines
|
$services = preg_replace("|(\s)+|", '$1', $services); // Kill dupe lines
|
||||||
|
if ('' != trim($services)) {
|
||||||
$services = explode("\n", trim($services));
|
$services = explode("\n", trim($services));
|
||||||
foreach ($services as $service) {
|
foreach ($services as $service) {
|
||||||
$uri = parse_url($service);
|
$uri = parse_url($service);
|
||||||
weblog_ping($uri['host'], $uri['path']);
|
weblog_ping($uri['host'], $uri['path']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
add_action('publish_post', 'generic_ping');
|
add_action('publish_post', 'generic_ping');
|
||||||
|
|
Loading…
Reference in New Issue