Maybe some pinging fixes?
git-svn-id: http://svn.automattic.com/wordpress/trunk@1256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ee19b6c490
commit
d8ab98d7b8
|
@ -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);
|
||||
|
|
|
@ -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 "<h3>Response Object Dump:</h3>
|
||||
<pre>\n";
|
||||
print_r($r);
|
||||
echo "</pre>\n";
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
print "<h3>Response Object Dump:</h3>\n";
|
||||
print "<pre>\n";
|
||||
print_r($r);
|
||||
print "</pre>\n";
|
||||
}
|
||||
$v = @phpxmlrpc_decode($r->value());
|
||||
if (!$r->faultCode()) {
|
||||
$result['message'] = "<p class=\"rpcmsg\">";
|
||||
$result['message'] = $result['message'] . $v["message"] . "<br />\n";
|
||||
$result['message'] = $result['message'] . "</p>";
|
||||
} else {
|
||||
$result['err'] = $r->faultCode();
|
||||
$result['message'] = "<!--\n";
|
||||
$result['message'] = $result['message'] . "Fault: ";
|
||||
$result['message'] = $result['message'] . "Code: " . $r->faultCode();
|
||||
$result['message'] = $result['message'] . " Reason '" .$r->faultString()."'<BR>";
|
||||
$result['message'] = $result['message'] . "-->\n";
|
||||
}
|
||||
|
||||
$v = @phpxmlrpc_decode($r->value());
|
||||
if (!$r->faultCode()) {
|
||||
$result['message'] = "<p class=\"rpcmsg\">";
|
||||
$result['message'] = $result['message'] . $v["message"] . "<br />\n";
|
||||
$result['message'] = $result['message'] . "</p>";
|
||||
} else {
|
||||
$result['err'] = $r->faultCode();
|
||||
$result['message'] = "<!--\n";
|
||||
$result['message'] = $result['message'] . "Fault: ";
|
||||
$result['message'] = $result['message'] . "Code: " . $r->faultCode();
|
||||
$result['message'] = $result['message'] . " Reason '" .$r->faultString()."'<BR>";
|
||||
$result['message'] = $result['message'] . "-->\n";
|
||||
}
|
||||
|
||||
if ($debug) print '<blockquote>' . $result['message'] . '</blockquote>';
|
||||
if ($debug) print '<blockquote>' . $result['message'] . '</blockquote>';
|
||||
}
|
||||
|
||||
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']);
|
||||
|
|
Loading…
Reference in New Issue