Changeset 22902
- Timestamp:
- 11/28/2012 08:17:57 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/async-upload.php
r22755 r22902 14 14 require_once('../wp-load.php'); 15 15 16 // Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead 17 if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) 18 $_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie']; 19 elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) 20 $_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie']; 21 if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) ) 22 $_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie']; 23 unset($current_user); 16 if ( ! ( isset( $_REQUEST['action'] ) && 'upload-attachment' == $_REQUEST['action'] ) ) { 17 // Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead 18 if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) 19 $_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie']; 20 elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) 21 $_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie']; 22 if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) ) 23 $_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie']; 24 unset($current_user); 25 } 26 24 27 require_once('./admin.php'); 28 29 if ( !current_user_can('upload_files') ) 30 wp_die(__('You do not have permission to upload files.')); 25 31 26 32 header('Content-Type: text/html; charset=' . get_option('blog_charset')); 27 33 28 if ( !current_user_can('upload_files') ) 29 wp_die(__('You do not have permission to upload files.')); 34 if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) { 35 define( 'DOING_AJAX', true ); 36 include ABSPATH . 'wp-admin/includes/ajax-actions.php'; 37 38 send_nosniff_header(); 39 nocache_headers(); 40 41 wp_ajax_upload_attachment(); 42 die( '0' ); 43 } 30 44 31 45 // just fetch the detail form for that attachment -
trunk/wp-includes/media.php
r22895 r22902 1247 1247 'multiple_queues' => true, 1248 1248 'max_file_size' => $max_upload_size . 'b', 1249 'url' => admin_url( 'a dmin-ajax.php', 'relative' ),1249 'url' => admin_url( 'async-upload.php', 'relative' ), 1250 1250 'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ), 1251 1251 'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
Note: See TracChangeset
for help on using the changeset viewer.