<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[20353] trunk/wp-includes/class-wp-xmlrpc-server.php: XMLRPC: Make sure that we always return valid dates when no date is currently set - for example if the post is pending.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/20353">20353</a></dd>
<dt>Author</dt> <dd>westi</dd>
<dt>Date</dt> <dd>2012-04-04 21:32:28 +0000 (Wed, 04 Apr 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>XMLRPC: Make sure that we always return valid dates when no date is currently set - for example if the post is pending. Fixes <a href="http://core.trac.wordpress.org/ticket/19733">#19733</a> props markoheijnen and koke. </pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesclasswpxmlrpcserverphp">trunk/wp-includes/class-wp-xmlrpc-server.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesclasswpxmlrpcserverphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/class-wp-xmlrpc-server.php (20352 => 20353)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-xmlrpc-server.php        2012-04-04 21:02:29 UTC (rev 20352)
+++ trunk/wp-includes/class-wp-xmlrpc-server.php        2012-04-04 21:32:28 UTC (rev 20353)
</span><span class="lines">@@ -499,7 +499,7 @@
</span><span class="cx">          * Prepares taxonomy data for return in an XML-RPC object.
</span><span class="cx">          *
</span><span class="cx">          * @access protected
</span><del>-        .*
</del><ins>+         *
</ins><span class="cx">          * @param array|object $taxonomy The unprepared taxonomy data
</span><span class="cx">          * @return array The prepared taxonomy data
</span><span class="cx">          */
</span><span class="lines">@@ -515,7 +515,7 @@
</span><span class="cx">          * Prepares term data for return in an XML-RPC object.
</span><span class="cx">          *
</span><span class="cx">          * @access protected
</span><del>-        .*
</del><ins>+         *
</ins><span class="cx">          * @param array|object $term The unprepared term data
</span><span class="cx">          * @return array The prepared term data
</span><span class="cx">          */
</span><span class="lines">@@ -552,6 +552,21 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /**
</span><ins>+         * Convert a WordPress gmt date string to an IXR_Date object.
+         *
+         * @access protected
+         *
+         * @param $date
+         * @return IXR_Date
+         */
+        protected function _convert_date_gmt( $date_gmt, $date ) {
+                if ( $date !== '0000-00-00 00:00:00' &amp;&amp; $date_gmt === '0000-00-00 00:00:00' ) {
+                        return new IXR_Date( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $date, false ), 'Ymd\TH:i:s' ) );
+                }
+                return $this-&gt;_convert_date( $date_gmt );
+        }
+
+        /**
</ins><span class="cx">          * Prepares post data for return in an XML-RPC object.
</span><span class="cx">          *
</span><span class="cx">          * @access protected
</span><span class="lines">@@ -568,9 +583,9 @@
</span><span class="cx">                 $post_fields = array(
</span><span class="cx">                         'post_title'        =&gt; $post['post_title'],
</span><span class="cx">                         'post_date'         =&gt; $this-&gt;_convert_date( $post['post_date'] ),
</span><del>-                        'post_date_gmt'     =&gt; $this-&gt;_convert_date( $post['post_date_gmt'] ),
</del><ins>+                        'post_date_gmt'     =&gt; $this-&gt;_convert_date_gmt( $post['post_date_gmt'], $post['post_date'] ),
</ins><span class="cx">                         'post_modified'     =&gt; $this-&gt;_convert_date( $post['post_modified'] ),
</span><del>-                        'post_modified_gmt' =&gt; $this-&gt;_convert_date( $post['post_modified_gmt'] ),
</del><ins>+                        'post_modified_gmt' =&gt; $this-&gt;_convert_date_gmt( $post['post_modified_gmt'], $post['post_modified'] ),
</ins><span class="cx">                         'post_status'       =&gt; $post['post_status'],
</span><span class="cx">                         'post_type'         =&gt; $post['post_type'],
</span><span class="cx">                         'post_name'         =&gt; $post['post_name'],
</span><span class="lines">@@ -1714,13 +1729,9 @@
</span><span class="cx">                         $allow_pings = pings_open($page-&gt;ID) ? 1 : 0;
</span><span class="cx"> 
</span><span class="cx">                         // Format page date.
</span><del>-                        $page_date = mysql2date('Ymd\TH:i:s', $page-&gt;post_date, false);
-                        $page_date_gmt = mysql2date('Ymd\TH:i:s', $page-&gt;post_date_gmt, false);
</del><ins>+                        $page_date = $this-&gt;_convert_date( $page-&gt;post_date );
+                        $page_date_gmt = $this-&gt;_convert_date_gmt( $page-&gt;post_date_gmt, $page-&gt;post_date );
</ins><span class="cx"> 
</span><del>-                        // For drafts use the GMT version of the date
-                        if ( $page-&gt;post_status == 'draft' )
-                                $page_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $page-&gt;post_date ), 'Ymd\TH:i:s' );
-
</del><span class="cx">                         // Pull the categories info together.
</span><span class="cx">                         $categories = array();
</span><span class="cx">                         foreach ( wp_get_post_categories($page-&gt;ID) as $cat_id ) {
</span><span class="lines">@@ -1735,7 +1746,7 @@
</span><span class="cx">                                 $page_template = 'default';
</span><span class="cx"> 
</span><span class="cx">                         $page_struct = array(
</span><del>-                                'dateCreated'                        =&gt; new IXR_Date($page_date),
</del><ins>+                                'dateCreated'                        =&gt; $page_date,
</ins><span class="cx">                                 'userid'                                =&gt; $page-&gt;post_author,
</span><span class="cx">                                 'page_id'                                =&gt; $page-&gt;ID,
</span><span class="cx">                                 'page_status'                        =&gt; $page-&gt;post_status,
</span><span class="lines">@@ -1756,7 +1767,7 @@
</span><span class="cx">                                 'wp_page_order'                        =&gt; $page-&gt;menu_order,
</span><span class="cx">                                 'wp_author_id'                        =&gt; (string) $author-&gt;ID,
</span><span class="cx">                                 'wp_author_display_name'        =&gt; $author-&gt;display_name,
</span><del>-                                'date_created_gmt'                =&gt; new IXR_Date($page_date_gmt),
</del><ins>+                                'date_created_gmt'                =&gt; $page_date_gmt,
</ins><span class="cx">                                 'custom_fields'                        =&gt; $this-&gt;get_custom_fields($page_id),
</span><span class="cx">                                 'wp_page_template'                =&gt; $page_template
</span><span class="cx">                         );
</span><span class="lines">@@ -1975,18 +1986,9 @@
</span><span class="cx">                 // The date needs to be formatted properly.
</span><span class="cx">                 $num_pages = count($page_list);
</span><span class="cx">                 for ( $i = 0; $i &lt; $num_pages; $i++ ) {
</span><del>-                        $post_date = mysql2date('Ymd\TH:i:s', $page_list[$i]-&gt;post_date, false);
-                        $post_date_gmt = mysql2date('Ymd\TH:i:s', $page_list[$i]-&gt;post_date_gmt, false);
</del><ins>+                        $page_list[$i]-&gt;dateCreated = $this-&gt;_convert_date(  $page_list[$i]-&gt;post_date );
+                        $page_list[$i]-&gt;date_created_gmt = $this-&gt;_convert_date_gmt( $page_list[$i]-&gt;post_date_gmt, $page_list[$i]-&gt;post_date );
</ins><span class="cx"> 
</span><del>-                        $page_list[$i]-&gt;dateCreated = new IXR_Date($post_date);
-                        $page_list[$i]-&gt;date_created_gmt = new IXR_Date($post_date_gmt);
-
-                        // For drafts use the GMT version of the date
-                        if ( $page_list[$i]-&gt;post_status == 'draft' ) {
-                                $page_list[$i]-&gt;date_created_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $page_list[$i]-&gt;post_date ), 'Ymd\TH:i:s' );
-                                $page_list[$i]-&gt;date_created_gmt = new IXR_Date( $page_list[$i]-&gt;date_created_gmt );
-                        }
-
</del><span class="cx">                         unset($page_list[$i]-&gt;post_date_gmt);
</span><span class="cx">                         unset($page_list[$i]-&gt;post_date);
</span><span class="cx">                         unset($page_list[$i]-&gt;post_status);
</span><span class="lines">@@ -2230,8 +2232,8 @@
</span><span class="cx">                         return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
</span><span class="cx"> 
</span><span class="cx">                 // Format page date.
</span><del>-                $comment_date = mysql2date('Ymd\TH:i:s', $comment-&gt;comment_date, false);
-                $comment_date_gmt = mysql2date('Ymd\TH:i:s', $comment-&gt;comment_date_gmt, false);
</del><ins>+                $comment_date = $this-&gt;_convert_date( $comment-&gt;comment_date );
+                $comment_date_gmt = $this-&gt;_convert_date_gmt( $comment-&gt;comment_date_gmt, $comment-&gt;comment_date );
</ins><span class="cx"> 
</span><span class="cx">                 if ( '0' == $comment-&gt;comment_approved )
</span><span class="cx">                         $comment_status = 'hold';
</span><span class="lines">@@ -2245,7 +2247,7 @@
</span><span class="cx">                 $link = get_comment_link($comment);
</span><span class="cx"> 
</span><span class="cx">                 $comment_struct = array(
</span><del>-                        'date_created_gmt'                =&gt; new IXR_Date($comment_date_gmt),
</del><ins>+                        'date_created_gmt'                =&gt; $comment_date_gmt,
</ins><span class="cx">                         'user_id'                                =&gt; $comment-&gt;user_id,
</span><span class="cx">                         'comment_id'                        =&gt; $comment-&gt;comment_ID,
</span><span class="cx">                         'parent'                                =&gt; $comment-&gt;comment_parent,
</span><span class="lines">@@ -2824,14 +2826,14 @@
</span><span class="cx">                         return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
</span><span class="cx"> 
</span><span class="cx">                 // Format page date.
</span><del>-                $attachment_date = mysql2date('Ymd\TH:i:s', $attachment-&gt;post_date, false);
-                $attachment_date_gmt = mysql2date('Ymd\TH:i:s', $attachment-&gt;post_date_gmt, false);
</del><ins>+                $attachment_date = $this-&gt;_convert_date( $attachment-&gt;post_date );
+                $attachment_date_gmt = $this-&gt;_convert_date_gmt( $attachment-&gt;post_date_gmt, $attachment-&gt;post_date );
</ins><span class="cx"> 
</span><span class="cx">                 $link = wp_get_attachment_url($attachment-&gt;ID);
</span><span class="cx">                 $thumbnail_link = wp_get_attachment_thumb_url($attachment-&gt;ID);
</span><span class="cx"> 
</span><span class="cx">                 $attachment_struct = array(
</span><del>-                        'date_created_gmt'                =&gt; new IXR_Date($attachment_date_gmt),
</del><ins>+                        'date_created_gmt'                =&gt; $attachment_date_gmt,
</ins><span class="cx">                         'parent'                                =&gt; $attachment-&gt;post_parent,
</span><span class="cx">                         'link'                                        =&gt; $link,
</span><span class="cx">                         'thumbnail'                                =&gt; $thumbnail_link,
</span><span class="lines">@@ -3182,7 +3184,7 @@
</span><span class="cx"> 
</span><span class="cx">                 $struct = array(
</span><span class="cx">                         'userid'    =&gt; $post_data['post_author'],
</span><del>-                        'dateCreated' =&gt; new IXR_Date(mysql2date('Ymd\TH:i:s', $post_data['post_date'], false)),
</del><ins>+                        'dateCreated' =&gt; $this-&gt;_convert_date( $post_data['post_date'] ),
</ins><span class="cx">                         'content'     =&gt; $content,
</span><span class="cx">                         'postid'  =&gt; (string) $post_data['ID']
</span><span class="cx">                 );
</span><span class="lines">@@ -3227,7 +3229,7 @@
</span><span class="cx">                         if ( !current_user_can( 'edit_post', $entry['ID'] ) )
</span><span class="cx">                                 continue;
</span><span class="cx"> 
</span><del>-                        $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false);
</del><ins>+                        $post_date  = $this-&gt;_convert_date( $entry['post_date'] );
</ins><span class="cx">                         $categories = implode(',', wp_get_post_categories($entry['ID']));
</span><span class="cx"> 
</span><span class="cx">                         $content  = '&lt;title&gt;'.stripslashes($entry['post_title']).'&lt;/title&gt;';
</span><span class="lines">@@ -3236,7 +3238,7 @@
</span><span class="cx"> 
</span><span class="cx">                         $struct[] = array(
</span><span class="cx">                                 'userid' =&gt; $entry['post_author'],
</span><del>-                                'dateCreated' =&gt; new IXR_Date($post_date),
</del><ins>+                                'dateCreated' =&gt; $post_date,
</ins><span class="cx">                                 'content' =&gt; $content,
</span><span class="cx">                                 'postid' =&gt; (string) $entry['ID'],
</span><span class="cx">                         );
</span><span class="lines">@@ -4123,17 +4125,11 @@
</span><span class="cx">                 $postdata = wp_get_single_post($post_ID, ARRAY_A);
</span><span class="cx"> 
</span><span class="cx">                 if ($postdata['post_date'] != '') {
</span><del>-                        $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date'], false);
-                        $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt'], false);
-                        $post_modified = mysql2date('Ymd\TH:i:s', $postdata['post_modified'], false);
-                        $post_modified_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_modified_gmt'], false);
</del><ins>+                        $post_date = $this-&gt;_convert_date( $postdata['post_date'] );
+                        $post_date_gmt = $this-&gt;_convert_date_gmt( $postdata['post_date_gmt'],  $postdata['post_date'] );
+                        $post_modified = $this-&gt;_convert_date( $postdata['post_modified'] );
+                        $post_modified_gmt = $this-&gt;_convert_date_gmt( $postdata['post_modified_gmt'], $postdata['post_modified'] );
</ins><span class="cx"> 
</span><del>-                        // For drafts use the GMT version of the post date
-                        if ( $postdata['post_status'] == 'draft' ) {
-                                $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_date'] ), 'Ymd\TH:i:s' );
-                                $post_modified_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_modified'] ), 'Ymd\TH:i:s' );
-                        }
-
</del><span class="cx">                         $categories = array();
</span><span class="cx">                         $catids = wp_get_post_categories($post_ID);
</span><span class="cx">                         foreach($catids as $catid)
</span><span class="lines">@@ -4185,7 +4181,7 @@
</span><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         $resp = array(
</span><del>-                                'dateCreated' =&gt; new IXR_Date($post_date),
</del><ins>+                                'dateCreated' =&gt; $post_date,
</ins><span class="cx">                                 'userid' =&gt; $postdata['post_author'],
</span><span class="cx">                                 'postid' =&gt; $postdata['ID'],
</span><span class="cx">                                 'description' =&gt; $post['main'],
</span><span class="lines">@@ -4204,14 +4200,14 @@
</span><span class="cx">                                 'wp_slug' =&gt; $postdata['post_name'],
</span><span class="cx">                                 'wp_password' =&gt; $postdata['post_password'],
</span><span class="cx">                                 'wp_author_id' =&gt; (string) $author-&gt;ID,
</span><del>-                                'wp_author_display_name'        =&gt; $author-&gt;display_name,
-                                'date_created_gmt' =&gt; new IXR_Date($post_date_gmt),
</del><ins>+                                'wp_author_display_name' =&gt; $author-&gt;display_name,
+                                'date_created_gmt' =&gt; $post_date_gmt,
</ins><span class="cx">                                 'post_status' =&gt; $postdata['post_status'],
</span><span class="cx">                                 'custom_fields' =&gt; $this-&gt;get_custom_fields($post_ID),
</span><span class="cx">                                 'wp_post_format' =&gt; $post_format,
</span><span class="cx">                                 'sticky' =&gt; $sticky,
</span><del>-                                'date_modified' =&gt; new IXR_Date( $post_modified ),
-                                'date_modified_gmt' =&gt; new IXR_Date( $post_modified_gmt )
</del><ins>+                                'date_modified' =&gt; $post_modified,
+                                'date_modified_gmt' =&gt; $post_modified_gmt
</ins><span class="cx">                         );
</span><span class="cx"> 
</span><span class="cx">                         if ( !empty($enclosure) ) $resp['enclosure'] = $enclosure;
</span><span class="lines">@@ -4259,17 +4255,11 @@
</span><span class="cx">                         if ( !current_user_can( 'edit_post', $entry['ID'] ) )
</span><span class="cx">                                 continue;
</span><span class="cx"> 
</span><del>-                        $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false);
-                        $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false);
-                        $post_modified = mysql2date('Ymd\TH:i:s', $entry['post_modified'], false);
-                        $post_modified_gmt = mysql2date('Ymd\TH:i:s', $entry['post_modified_gmt'], false);
</del><ins>+                        $post_date = $this-&gt;_convert_date( $entry['post_date'] );
+                        $post_date_gmt = $this-&gt;_convert_date_gmt( $entry['post_date_gmt'], $entry['post_date'] );
+                        $post_modified = $this-&gt;_convert_date( $entry['post_modified'] );
+                        $post_modified_gmt = $this-&gt;_convert_date_gmt( $entry['post_modified_gmt'], $entry['post_modified'] );
</ins><span class="cx"> 
</span><del>-                        // For drafts use the GMT version of the date
-                        if ( $entry['post_status'] == 'draft' ) {
-                                $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_date'] ), 'Ymd\TH:i:s' );
-                                $post_modified_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_modified'] ), 'Ymd\TH:i:s' );
-                        }
-
</del><span class="cx">                         $categories = array();
</span><span class="cx">                         $catids = wp_get_post_categories($entry['ID']);
</span><span class="cx">                         foreach( $catids as $catid )
</span><span class="lines">@@ -4305,7 +4295,7 @@
</span><span class="cx">                                 $post_format = 'standard';
</span><span class="cx"> 
</span><span class="cx">                         $struct[] = array(
</span><del>-                                'dateCreated' =&gt; new IXR_Date($post_date),
</del><ins>+                                'dateCreated' =&gt; $post_date,
</ins><span class="cx">                                 'userid' =&gt; $entry['post_author'],
</span><span class="cx">                                 'postid' =&gt; (string) $entry['ID'],
</span><span class="cx">                                 'description' =&gt; $post['main'],
</span><span class="lines">@@ -4325,12 +4315,12 @@
</span><span class="cx">                                 'wp_password' =&gt; $entry['post_password'],
</span><span class="cx">                                 'wp_author_id' =&gt; (string) $author-&gt;ID,
</span><span class="cx">                                 'wp_author_display_name' =&gt; $author-&gt;display_name,
</span><del>-                                'date_created_gmt' =&gt; new IXR_Date($post_date_gmt),
</del><ins>+                                'date_created_gmt' =&gt; $post_date_gmt,
</ins><span class="cx">                                 'post_status' =&gt; $entry['post_status'],
</span><span class="cx">                                 'custom_fields' =&gt; $this-&gt;get_custom_fields($entry['ID']),
</span><span class="cx">                                 'wp_post_format' =&gt; $post_format,
</span><del>-                                'date_modified' =&gt; new IXR_Date( $post_modified ),
-                                'date_modified_gmt' =&gt; new IXR_Date( $post_modified_gmt )
</del><ins>+                                'date_modified' =&gt; $post_modified,
+                                'date_modified_gmt' =&gt; $post_modified_gmt
</ins><span class="cx">                         );
</span><span class="cx"> 
</span><span class="cx">                         $entry_index = count( $struct ) - 1;
</span><span class="lines">@@ -4516,20 +4506,16 @@
</span><span class="cx">                         if ( !current_user_can( 'edit_post', $entry['ID'] ) )
</span><span class="cx">                                 continue;
</span><span class="cx"> 
</span><del>-                        $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false);
-                        $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false);
</del><ins>+                        $post_date = $this-&gt;_convert_date( $entry['post_date'] );
+                        $post_date_gmt = $this-&gt;_convert_date_gmt( $entry['post_date_gmt'], $entry['post_date'] );
</ins><span class="cx"> 
</span><del>-                        // For drafts use the GMT version of the date
-                        if ( $entry['post_status'] == 'draft' )
-                                $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_date'] ), 'Ymd\TH:i:s' );
-
</del><span class="cx">                         $struct[] = array(
</span><del>-                                'dateCreated' =&gt; new IXR_Date($post_date),
</del><ins>+                                'dateCreated' =&gt; $post_date,
</ins><span class="cx">                                 'userid' =&gt; $entry['post_author'],
</span><span class="cx">                                 'postid' =&gt; (string) $entry['ID'],
</span><span class="cx">                                 'title' =&gt; $entry['post_title'],
</span><span class="cx">                                 'post_status' =&gt; $entry['post_status'],
</span><del>-                                'date_created_gmt' =&gt; new IXR_Date($post_date_gmt)
</del><ins>+                                'date_created_gmt' =&gt; $post_date_gmt
</ins><span class="cx">                         );
</span><span class="cx"> 
</span><span class="cx">                 }
</span></span></pre>
</div>
</div>

</body>
</html>