Skip to content

Commit ceeb99e

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@45650 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 8df86ef commit ceeb99e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/wp-admin/admin-ajax.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
/** Allow for cross-domain requests (from the front end). */
2525
send_origin_headers();
2626

27+
header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
28+
header( 'X-Robots-Tag: noindex' );
29+
2730
// Require an action parameter
2831
if ( empty( $_REQUEST['action'] ) ) {
2932
wp_die( '0', 400 );
@@ -35,9 +38,6 @@
3538
/** Load Ajax Handlers for WordPress Core */
3639
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
3740

38-
header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
39-
header( 'X-Robots-Tag: noindex' );
40-
4141
send_nosniff_header();
4242
nocache_headers();
4343

0 commit comments

Comments
 (0)