Make WordPress Core


Ignore:
Timestamp:
11/18/2016 04:55:03 PM (10 years ago)
Author:
rachelbaker
Message:

REST API: On comment create, return an error if the post parameter does not relate to a valid WP_Post object.

Return a WP_Error object for attempts to create a comment without an empty or invalid post ID.

Props dd32, jnylen0, rachelbaker.
Fixes #38816.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php

    r39287 r39288  
    13071307
    13081308                $response = $this->server->dispatch( $request );
    1309                 $this->assertEquals( 201, $response->get_status() );
     1309
     1310                $this->assertErrorResponse( 'rest_comment_invalid_post_id', $response, 403 );
    13101311        }
    13111312
Note: See TracChangeset for help on using the changeset viewer.