Make WordPress Core

Opened 6 weeks ago

Closed 6 weeks ago

#62682 closed defect (bug) (duplicate)

Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given

Reported by: akeda's profile akeda Owned by:
Milestone: Priority: normal
Severity: minor Version: trunk
Component: REST API Keywords:
Focuses: Cc:

Description

To trigger this error:

curl 'http://localhost:8889//wp-json/wp/v2/pages/?format=text'

Stack trace:

#0 /var/www/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(363): in_array('standard', 'text', true)
#1 /var/www/src/wp-includes/rest-api/class-wp-rest-server.php(1292): WP_REST_Posts_Controller->get_items(Object(WP_REST_Request))
#2 /var/www/src/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wp/v2/pages', Array, NULL)
#3 /var/www/src/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch(Object(WP_REST_Request))
#4 /var/www/src/wp-includes/rest-api.php(449): WP_REST_Server->serve_request('/wp/v2/pages')
#5 /var/www/src/wp-includes/class-wp-hook.php(324): rest_api_loaded(Object(WP))
#6 /var/www/src/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#7 /var/www/src/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#8 /var/www/src/wp-includes/class-wp.php(418): do_action_ref_array('parse_request', Array)
#9 /var/www/src/wp-includes/class-wp.php(813): WP->parse_request('')
#10 /var/www/src/wp-includes/functions.php(1337): WP->main('')
#11 /var/www/src/wp-blog-header.php(16): wp()
#12 /var/www/src/_index.php(17): require('/var/www/src/wp...')
#13 /var/www/src/index.php(19): require_once('/var/www/src/_i...')
#14 {main}
  thrown in <b>/var/www/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php</b> on line <b>363</b><br />

Change History (1)

#1 @dd32
6 weeks ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @akeda welcome to Core Trac!

Thanks for reporting this, it's being tracked via #62646

Note: See TracTickets for help on using tickets.