mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Administration: Send an appropriate HTTP response status code when an invalid action is passed to admin-ajax.php.
Props ryanrolds, ayeshrajans Fixes #41269 git-svn-id: https://develop.svn.wordpress.org/trunk@41120 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
28e67acdce
commit
384ac2a367
@ -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 );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user