From 2efb81d4535bbf21a44a18a76586b50c757d9456 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 23 Jul 2017 00:21:42 +0000 Subject: [PATCH] Administration: Send an appropriate HTTP response status code when an invalid action is passed to `admin-ajax.php`. Props ryanrolds, ayeshrajans Fixes #41269 Built from https://develop.svn.wordpress.org/trunk@41120 git-svn-id: http://core.svn.wordpress.org/trunk@40960 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-ajax.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 3213d55028..f5b1c50f9a 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -26,7 +26,7 @@ send_origin_headers(); // Require an action parameter if ( empty( $_REQUEST['action'] ) ) - die( '0' ); + wp_die( '0', 400 ); /** Load WordPress Administration APIs */ require_once( ABSPATH . 'wp-admin/includes/admin.php' ); @@ -101,4 +101,4 @@ if ( is_user_logged_in() ) { do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); } // Default status -die( '0' ); +wp_die( '0', 400 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index d21602e380..8669137f58 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41119'; +$wp_version = '4.9-alpha-41120'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.