From 5965616acaf13596a4764b294ca28e8dc9ee8fcb Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 15 Mar 2014 19:59:15 +0000 Subject: [PATCH] Define DOING_AJAX earlier in async-upload.php. props avryl. fixes #27387. see [22902]. Built from https://develop.svn.wordpress.org/trunk@27558 git-svn-id: http://core.svn.wordpress.org/trunk@27401 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/async-upload.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-admin/async-upload.php b/wp-admin/async-upload.php index a16c8d3aa8..b54951171c 100644 --- a/wp-admin/async-upload.php +++ b/wp-admin/async-upload.php @@ -6,6 +6,10 @@ * @subpackage Administration */ +if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) { + define( 'DOING_AJAX', true ); +} + define('WP_ADMIN', true); if ( defined('ABSPATH') ) @@ -32,7 +36,6 @@ if ( !current_user_can('upload_files') ) header('Content-Type: text/html; charset=' . get_option('blog_charset')); if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) { - define( 'DOING_AJAX', true ); include ABSPATH . 'wp-admin/includes/ajax-actions.php'; send_nosniff_header();