Changeset 22902 for trunk/wp-admin/async-upload.php
- Timestamp:
- 11/28/2012 08:17:57 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/async-upload.php (modified) (1 diff)
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
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)