Ticket #22622: 22622.4.diff
| File 22622.4.diff, 2.9 KB (added by koopersmith, 7 months ago) |
|---|
-
wp-admin/async-upload.php
13 13 else 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'); 25 28 26 header('Content-Type: text/html; charset=' . get_option('blog_charset'));27 28 29 if ( !current_user_can('upload_files') ) 29 30 wp_die(__('You do not have permission to upload files.')); 30 31 32 header('Content-Type: text/html; charset=' . get_option('blog_charset')); 33 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 } 44 31 45 // just fetch the detail form for that attachment 32 46 if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) { 33 47 $post = get_post( $id ); -
wp-includes/media.php
1246 1246 'file_data_name' => 'async-upload', // key passed to $_FILE. 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' ), 1252 1252 'filters' => array( array( 'title' => __( 'Allowed Files' ), 'extensions' => '*') ),