[wp-trac] [WordPress Trac] #28601: wp.newPost fatals when a post_date field is included in the data

WordPress Trac noreply at wordpress.org
Thu Jun 26 16:25:19 UTC 2014


#28601: wp.newPost fatals when a post_date field is included in the data
--------------------------+------------------
 Reporter:  dllh          |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.0
Component:  XML-RPC       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------

Comment (by dllh):

 Replying to [comment:4 SergeyBiryukov]:
 > I wonder if these checks should go into `_insert_post()` method instead,
 where most of the validation happens.

 That was actually my first impulse, and the first version of the patch
 (not attached). I moved it out of that function with these thoughts in
 mind:

 * Maybe somebody had a good reason for putting the validation in
 `wp_editPost()`, so following that model was perhaps a good first step.
 * It's possible somebody extends the xml-rpc server with custom code that
 does its own checks. If they're convertng in their function (because we're
 not) and we reconvert in `_insert_post()`, we'll introduce another error.
 Introducing higher in the stack seemed both consistent with past code and
 safer going forward. Of course, we could add an `is_a()` check or
 something to prevent double conversion.

 I'd be happy to rework the patch to move the validation into
 `_insert_post()` if you think that's better, though. What say you?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28601#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list