From 6c28dfde29aae480acf4a45d2aa3ab9be6d66c40 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 15 Mar 2014 19:58:52 +0000 Subject: [PATCH] Define DOING_AJAX earlier in async-upload.php. props avryl. fixes #27387. see [22902]. git-svn-id: https://develop.svn.wordpress.org/trunk@27558 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/async-upload.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/async-upload.php b/src/wp-admin/async-upload.php index a16c8d3aa8..b54951171c 100644 --- a/src/wp-admin/async-upload.php +++ b/src/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();