Changeset 57839
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php
r57648 r57839 396 396 $type = $request->get_param( self::PROP_TYPE ); 397 397 398 if ( ! $type || ! is set( $this->search_handlers[ $type ] ) ) {398 if ( ! $type || ! is_string( $type ) || ! isset( $this->search_handlers[ $type ] ) ) { 399 399 return new WP_Error( 400 400 'rest_search_invalid_type', -
trunk/tests/phpunit/tests/rest-api/rest-search-controller.php
r56547 r57839 889 889 ); 890 890 } 891 892 /** 893 * @ticket 60771 894 */ 895 public function test_sanitize_subtypes_validates_type() { 896 $response = $this->do_request_with_params( 897 array( 898 'subtype' => 'page', 899 'type' => array( 'invalid' ), 900 ) 901 ); 902 903 $this->assertErrorResponse( 'rest_invalid_param', $response, 400 ); 904 } 891 905 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)