[wp-trac] [WordPress Trac] #20548: xmlrpc "getrecentposts" inconsistent with "getpost"
WordPress Trac
wp-trac at lists.automattic.com
Thu Apr 26 10:05:20 UTC 2012
#20548: xmlrpc "getrecentposts" inconsistent with "getpost"
--------------------------+------------------------------
Reporter: kevbo | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: XML-RPC | Version:
Severity: minor | Resolution:
Keywords: |
--------------------------+------------------------------
Description changed by SergeyBiryukov:
Old description:
> In /wp-includes/class-wp-xmlrpc-server.php the return array for
> mw_getPost sets the postid as an int. For mw_getRecentPosts postid is
> cast as a string. (lines 1827 & 2810)
>
> Rev 16508 first cast the int as string in response to ticket 15517. The
> reference given was an old MSDN article. However, the Blogger API
> actually says the post ID should be numerical, not a string.
>
> (See Blogger API Post definition here:
> https://developers.google.com/blogger/docs/2.0/json/reference/posts#resource)
>
> Suggestion: Remove the cast to string for postid.
>
> (Clients which use XML-RPC calls likely (and logically) expect that the
> struct of the post should be the same. For example, the .NET library
> JoeBlogs expects that mw_getPost return a certain struct whereas
> mw_getRecentPosts would return an array of structs.)
New description:
In /wp-includes/class-wp-xmlrpc-server.php the return array for mw_getPost
sets the postid as an int. For mw_getRecentPosts postid is cast as a
string. (lines 1827 & 2810)
Rev 16508 first cast the int as string in response to ticket #15517. The
reference given was an old MSDN article. However, the Blogger API actually
says the post ID should be numerical, not a string.
(See Blogger API Post definition here:
https://developers.google.com/blogger/docs/2.0/json/reference/posts#resource)
Suggestion: Remove the cast to string for postid.
(Clients which use XML-RPC calls likely (and logically) expect that the
struct of the post should be the same. For example, the .NET library
JoeBlogs expects that mw_getPost return a certain struct whereas
mw_getRecentPosts would return an array of structs.)
--
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20548#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list