Administration: In admin-ajax.php, send X-Robots-Tag header earlier, so that it applies before wp_die() when no action parameter was provided.

Props robi-bobi, harryfear, garrett-eclipse.
Fixes #47711.
Built from https://develop.svn.wordpress.org/trunk@45650


git-svn-id: http://core.svn.wordpress.org/trunk@45461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-07-17 01:11:56 +00:00
parent 66afb60397
commit 1f256f3fdc
2 changed files with 4 additions and 4 deletions

View File

@ -24,6 +24,9 @@ require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
/** Allow for cross-domain requests (from the front end). */
send_origin_headers();
header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
header( 'X-Robots-Tag: noindex' );
// Require an action parameter
if ( empty( $_REQUEST['action'] ) ) {
wp_die( '0', 400 );
@ -35,9 +38,6 @@ require_once( ABSPATH . 'wp-admin/includes/admin.php' );
/** Load Ajax Handlers for WordPress Core */
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
header( 'X-Robots-Tag: noindex' );
send_nosniff_header();
nocache_headers();

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-45649';
$wp_version = '5.3-alpha-45650';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.