[wp-trac] [WordPress Trac] #38971: rest_comment_author_required should not allow empty value

WordPress Trac noreply at wordpress.org
Mon Nov 28 20:37:30 UTC 2016


#38971: rest_comment_author_required should not allow empty value
--------------------------+-----------------------------
 Reporter:  hnle          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:  rest-api      |
--------------------------+-----------------------------
 in https://core.trac.wordpress.org/browser/trunk/src/wp-includes/rest-
 api/endpoints/class-wp-rest-comments-controller.php#L515, it detect that
 "is the author param has set", but it allow empty value.

 require_name_email option is true, and request data like that:

 {"author_email":"foo at bar.com","author_url":"","content":"comment","post":"2192","parent":"0"}

 it return 400 with rest_comment_author_required, but with empty field like

 {"author_email":"foo at bar.com","author_name":"","author_url":"","content":"comment","post":"2192","parent":"0"}

 it passed (201 Created).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38971>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list