summaryrefslogtreecommitdiffstats
path: root/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php')
-rw-r--r--wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php
index cc1c302..55fe1ad 100644
--- a/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php
+++ b/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php
@@ -395,7 +395,7 @@ class WP_REST_Search_Controller extends WP_REST_Controller {
protected function get_search_handler( $request ) {
$type = $request->get_param( self::PROP_TYPE );
- if ( ! $type || ! isset( $this->search_handlers[ $type ] ) ) {
+ if ( ! $type || ! is_string( $type ) || ! isset( $this->search_handlers[ $type ] ) ) {
return new WP_Error(
'rest_search_invalid_type',
__( 'Invalid type parameter.' ),