From 1f256f3fdca8f68c05e7532b24ebb0bd74fc5d28 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 17 Jul 2019 01:11:56 +0000 Subject: [PATCH] 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 --- wp-admin/admin-ajax.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index f284387945..6be4a87a13 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -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(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 066139bcaa..756e576f8f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.