From 8090ae273d19ae01c168fdaffc8bcb0910a1521e Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 3 Jan 2016 19:49:32 +0000 Subject: [PATCH] XML-RPC: Revert [34681] as it broke date handling. props dossy, hnle, redsweater. see #35053, #30429 (original ticket). Built from https://develop.svn.wordpress.org/trunk@36163 git-svn-id: http://core.svn.wordpress.org/trunk@36129 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-xmlrpc-server.php | 16 ++++++++-------- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 31e5e4505f..8660bfdc5a 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -1352,8 +1352,8 @@ class wp_xmlrpc_server extends IXR_Server { } if ( ! empty( $dateCreated ) ) { - $post_data['post_date'] = iso8601_to_datetime( $dateCreated ); - $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] ); + $post_data['post_date'] = get_date_from_gmt( iso8601_to_datetime( $dateCreated ) ); + $post_data['post_date_gmt'] = iso8601_to_datetime( $dateCreated, 'GMT' ); } if ( ! isset( $post_data['ID'] ) ) @@ -3426,8 +3426,8 @@ class wp_xmlrpc_server extends IXR_Server { if ( !empty( $content_struct['date_created_gmt'] ) ) { // We know this is supposed to be GMT, so we're going to slap that Z on there by force $dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z'; - $comment_date = iso8601_to_datetime( $dateCreated ); - $comment_date_gmt = get_gmt_from_date( $comment_date ); + $comment_date = get_date_from_gmt(iso8601_to_datetime($dateCreated)); + $comment_date_gmt = iso8601_to_datetime($dateCreated, 'GMT'); } if ( isset($content_struct['content']) ) @@ -5005,8 +5005,8 @@ class wp_xmlrpc_server extends IXR_Server { $dateCreated = $content_struct['dateCreated']->getIso(); if ( !empty( $dateCreated ) ) { - $post_date = iso8601_to_datetime( $dateCreated ); - $post_date_gmt = get_gmt_from_date( $post_date ); + $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated)); + $post_date_gmt = iso8601_to_datetime($dateCreated, 'GMT'); } else { $post_date = ''; $post_date_gmt = ''; @@ -5363,8 +5363,8 @@ class wp_xmlrpc_server extends IXR_Server { $dateCreated = $content_struct['dateCreated']->getIso(); if ( !empty( $dateCreated ) ) { - $post_date = iso8601_to_datetime( $dateCreated ); - $post_date_gmt = get_gmt_from_date( $post_date, 'GMT' ); + $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']; diff --git a/wp-includes/version.php b/wp-includes/version.php index c5daf154dd..c57cbd47bc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36162'; +$wp_version = '4.5-alpha-36163'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.