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
This commit is contained in:
John Blackbourn 2017-07-23 00:21:42 +00:00
parent a4a0f65a8a
commit 2efb81d453
2 changed files with 3 additions and 3 deletions

View File

@ -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 );

View File

@ -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.