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
This commit is contained in:
Andrew Nacin 2014-03-15 19:58:52 +00:00
parent d017a789bc
commit 6c28dfde29
1 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,10 @@
* @subpackage Administration * @subpackage Administration
*/ */
if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
define( 'DOING_AJAX', true );
}
define('WP_ADMIN', true); define('WP_ADMIN', true);
if ( defined('ABSPATH') ) if ( defined('ABSPATH') )
@ -32,7 +36,6 @@ if ( !current_user_can('upload_files') )
header('Content-Type: text/html; charset=' . get_option('blog_charset')); header('Content-Type: text/html; charset=' . get_option('blog_charset'));
if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) { if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
define( 'DOING_AJAX', true );
include ABSPATH . 'wp-admin/includes/ajax-actions.php'; include ABSPATH . 'wp-admin/includes/ajax-actions.php';
send_nosniff_header(); send_nosniff_header();