WordPress.org

Make WordPress Core

Ticket #10739: pass-logged-in-cookie-to-async-upload.diff

File pass-logged-in-cookie-to-async-upload.diff, 1.2 KB (added by nbachiyski, 5 years ago)
  • wp-admin/includes/media.php

     
    13311331                        post_params : { 
    13321332                                "post_id" : "<?php echo $post_id; ?>", 
    13331333                                "auth_cookie" : "<?php if ( is_ssl() ) echo $_COOKIE[SECURE_AUTH_COOKIE]; else echo $_COOKIE[AUTH_COOKIE]; ?>", 
     1334                                "logged_in_cookie": "<?php echo $_COOKIE[LOGGED_IN_COOKIE]; ?>", 
    13341335                                "_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>", 
    13351336                                "type" : "<?php echo $type; ?>", 
    13361337                                "tab" : "<?php echo $tab; ?>", 
  • wp-admin/async-upload.php

     
    1818        $_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie']; 
    1919elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) 
    2020        $_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie']; 
     21if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) ) 
     22        $_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie']; 
    2123unset($current_user); 
    2224require_once('admin.php'); 
    2325