diff --git a/wp-admin/post.php b/wp-admin/post.php index f9ad7ac2ce..aa64fcc856 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -269,7 +269,6 @@ case 'editpost': $post_ID = $_POST['post_ID']; $post_categories = $_POST['post_category']; if (!$post_categories) $post_categories[] = 1; - $post_autobr = intval($_POST['post_autobr']); $content = balanceTags($_POST['content']); $content = format_to_post($content); $excerpt = balanceTags($_POST['excerpt']); @@ -285,6 +284,8 @@ case 'editpost': } else { $latlonaddition = " post_lat=null, post_lon=null, "; } + } else { + $latlonaddition = ''; } $prev_status = $_POST['prev_status']; $post_status = $_POST['post_status']; @@ -302,7 +303,7 @@ case 'editpost': // Format trackbacks $trackback = preg_replace('|\s+|', '\n', $trackback); - if ('' != $_POST['publish']) $post_status = 'publish'; + if (isset($_POST['publish'])) $post_status = 'publish'; if (($user_level > 4) && (!empty($_POST['edit_date']))) { $aa = $_POST['aa']; @@ -364,7 +365,8 @@ $now_gmt = current_time('mysql', 1); } // are we going from draft/private to published? - if ((($prev_status == 'draft') || ($prev_status == 'private')) && ($post_status == 'publish')) { + if ($prev_status != 'publish' && $post_status == 'publish') { + generic_ping(); } // end if moving from draft/private to published if ($post_status == 'publish') { do_action('publish_post', $post_ID); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 02ad4c91a1..53318cb97d 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -493,44 +493,46 @@ function timer_stop($display=0,$precision=3) { //if called like timer_stop(1), w } function weblog_ping($server = '', $path = '') { -include_once (ABSPATH . WPINC . '/class-xmlrpc.php'); -include_once (ABSPATH . WPINC . '/class-xmlrpcs.php'); + $debug = false; + include_once (ABSPATH . WPINC . '/class-xmlrpc.php'); + include_once (ABSPATH . WPINC . '/class-xmlrpcs.php'); - $f = new xmlrpcmsg('weblogUpdates.ping', - array(new xmlrpcval(get_settings('blogname'), 'string'), - new xmlrpcval(get_settings('home') ,'string'))); - $c = new xmlrpc_client($path, $server, 80); - $r = $c->send($f); + $f = new xmlrpcmsg('weblogUpdates.ping', + array(new xmlrpcval(get_settings('blogname'), 'string'), + new xmlrpcval(get_settings('home') ,'string'))); + $c = new xmlrpc_client($path, $server, 80); + $r = $c->send($f); + + if ($debug) { + echo "
\n"; + print_r($r); + echo "\n"; + } - if ($debug) { - print "
\n"; - print_r($r); - print "\n"; - } + $v = @phpxmlrpc_decode($r->value()); + if (!$r->faultCode()) { + $result['message'] = "
";
+ $result['message'] = $result['message'] . $v["message"] . "
\n";
+ $result['message'] = $result['message'] . "
";
- $result['message'] = $result['message'] . $v["message"] . "
\n";
- $result['message'] = $result['message'] . "
' . $result['message'] . ''; + if ($debug) print '
' . $result['message'] . ''; } function generic_ping($post_id = 0) { $services = get_settings('ping_sites'); $services = preg_replace("|(\s)+|", '$1', $services); // Kill dupe lines - if ('' != trim($services)) { - $services = explode("\n", trim($services)); + $services = trim($services); + if ('' != $services) { + $services = explode("\n", $services); foreach ($services as $service) { $uri = parse_url($service); weblog_ping($uri['host'], $uri['path']);