Forums

xmlrpc - createDate bug (2 posts)

  1. damko
    Member
    Posted 3 years ago #

    Hi all
    I have found a bug in xmlrpc.php.

    This is the issue:
    using metaWeblog.newPost method and setting createDate or date_created_gmt attribute I always have an error, doesn't matter the date format used.
    So I downloaded 2.6.2 code and I found in xmlrpc.php

    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();

    Of course both $content_struct['dateCreated'] and $content_struct['date_created_gmt'] are not objects. So you can't call a methos on it. They are strings. That's why every format used gave an error.

    This bug was documented also here http://www.franzone.com/2007/07/30/wordpress-xml-rpc-patch-for-metweblog-newpost-method/#comment-4063 a year ago and a there was a patch too. I see that the code was modified but the bug is still there. That's somewhat strange...

    Unfortunately my blog is hosted in wordpress.com so I can't fix it by myself. Is there a way to fix it ?

    Any help?

  2. damko
    Member
    Posted 3 years ago #

    I have patched xmlrpc.php, but I don't see any reply to my post. Is there someone interested ?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags