[wp-trac] [WordPress Trac] #13300: class IXR_Date transforms invalid timestamp.

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 22 10:10:04 UTC 2010


#13300: class IXR_Date transforms invalid timestamp.
--------------------------+-------------------------------------------------
 Reporter:  nasenmann     |        Owner:  josephscott
     Type:  defect (bug)  |       Status:  closed     
 Priority:  normal        |    Milestone:  Unassigned 
Component:  XML-RPC       |      Version:  3.0        
 Severity:  normal        |   Resolution:  worksforme 
 Keywords:  has-patch     |  
--------------------------+-------------------------------------------------
Changes (by mathiasschopmans):

  * keywords:  reporter-feedback => has-patch
  * status:  new => closed
  * version:  2.9.2 => 3.0
  * resolution:  => worksforme


Comment:

 it's pretty hard for me to explain, but i'll try:

 - i'm using wordpress to aggregate content from other wordpress blogs
 - i've written a wordpress plugin, which uses the class-IXR.php to send
 blogposts via XML-RPC to the motherblog.
 - '''to sync the post date i'm converting the post_date via new IXR_Date()
 but the current implemetation returns a invalid string.'''

 - using my fix solves the problem and returns a valid XML-RPC IXR_Date
 string

 it is a known bug in IXR_Date. see http://www.freelists.org/post/dokuwiki
 /Bug-IXR-DateparseIsoiso-works-incorrect


 {{{
 $client = new IXR_Client($xmlRpcUrl);

                 $params [] = $id;
                 $params [] = $this->wpUser;
                 $params [] = $this->wpPassword;
                 $params [] = array(
                                                 'title' => $title,
                                                 'categories' =>
 $categories,
                                                 'description' => $content,
                                                 'mt_excerpt' => $excerpt,
                                                 'mt_keywords' => $tags,
                                                 'custom_fields' =>
 $customFields,
                                                 'date_created_gmt' => new
 IXR_Date($date),
                                                 'post_status' => $publish
                                         );
                 $params [] = $publish != 'publish' ? 0 : 1;

                 $result = $client->query('metaWeblog.newPost', $params);
 }}}


 thanks.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13300#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list