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
This commit is contained in:
ryan 2008-01-30 20:33:14 +00:00
parent d88d4f85dd
commit 491aec7937
1 changed files with 15 additions and 9 deletions

View File

@ -1295,9 +1295,12 @@ class wp_xmlrpc_server extends IXR_Server {
$to_ping = implode(' ', $to_ping); $to_ping = implode(' ', $to_ping);
// Do some timestamp voodoo // Do some timestamp voodoo
$dateCreatedd = $content_struct['dateCreated']; if ( !empty( $content_struct['date_created_gmt'] ) )
if (!empty($dateCreatedd)) { $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
$dateCreated = $dateCreatedd->getIso(); 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 = get_date_from_gmt(iso8601_to_datetime($dateCreated));
$post_date_gmt = iso8601_to_datetime($dateCreated, GMT); $post_date_gmt = iso8601_to_datetime($dateCreated, GMT);
} else { } else {
@ -1553,11 +1556,14 @@ class wp_xmlrpc_server extends IXR_Server {
$to_ping = implode(' ', $to_ping); $to_ping = implode(' ', $to_ping);
// Do some timestamp voodoo // Do some timestamp voodoo
$dateCreatedd = $content_struct['dateCreated']; if ( !empty( $content_struct['date_created_gmt'] ) )
if (!empty($dateCreatedd)) { $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
$dateCreated = $dateCreatedd->getIso(); 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 = get_date_from_gmt(iso8601_to_datetime($dateCreated));
$post_date_gmt = iso8601_to_datetime($dateCreated . "Z", GMT); $post_date_gmt = iso8601_to_datetime($dateCreated, GMT);
} else { } else {
$post_date = $postdata['post_date']; $post_date = $postdata['post_date'];
$post_date_gmt = $postdata['post_date_gmt']; $post_date_gmt = $postdata['post_date_gmt'];