From 491aec7937a3b1c7d1e23f34bd572fc59adcf574 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 30 Jan 2008 20:33:14 +0000 Subject: [PATCH] Future post publishing over XML-RPC fixes from markjaquith. fixes #5721 git-svn-id: http://svn.automattic.com/wordpress/trunk@6691 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- xmlrpc.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/xmlrpc.php b/xmlrpc.php index cb8cda625..969b41181 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -1295,9 +1295,12 @@ class wp_xmlrpc_server extends IXR_Server { $to_ping = implode(' ', $to_ping); // Do some timestamp voodoo - $dateCreatedd = $content_struct['dateCreated']; - if (!empty($dateCreatedd)) { - $dateCreated = $dateCreatedd->getIso(); + if ( !empty( $content_struct['date_created_gmt'] ) ) + $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force + elseif ( !empty( $content_struct['dateCreated']) ) + $dateCreated = $content_struct['dateCreated']->getIso(); + + if ( !empty( $dateCreated ) ) { $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated)); $post_date_gmt = iso8601_to_datetime($dateCreated, GMT); } else { @@ -1551,13 +1554,16 @@ class wp_xmlrpc_server extends IXR_Server { $to_ping = $content_struct['mt_tb_ping_urls']; if ( is_array($to_ping) ) $to_ping = implode(' ', $to_ping); - + // Do some timestamp voodoo - $dateCreatedd = $content_struct['dateCreated']; - if (!empty($dateCreatedd)) { - $dateCreated = $dateCreatedd->getIso(); - $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated)); - $post_date_gmt = iso8601_to_datetime($dateCreated . "Z", GMT); + if ( !empty( $content_struct['date_created_gmt'] ) ) + $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force + elseif ( !empty( $content_struct['dateCreated']) ) + $dateCreated = $content_struct['dateCreated']->getIso(); + + if ( !empty( $dateCreated ) ) { + $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated)); + $post_date_gmt = iso8601_to_datetime($dateCreated, GMT); } else { $post_date = $postdata['post_date']; $post_date_gmt = $postdata['post_date_gmt'];