Ticket #16875: 16875.patch

File 16875.patch, 820 bytes (added by hakre, 2 years ago)
  • wp-includes/pluggable.php

     
    805805        // The cookie is no good so force login 
    806806        nocache_headers(); 
    807807 
    808         if ( is_ssl() ) 
    809                 $proto = 'https://'; 
     808        if ( strpos( $_SERVER['REQUEST_URI'], '/options.php' ) && $referer = wp_get_referer() ) 
     809                $redirect = $referer; 
    810810        else 
    811                 $proto = 'http://'; 
     811                $redirect = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 
    812812 
    813         $redirect = ( strpos($_SERVER['REQUEST_URI'], '/options.php') && wp_get_referer() ) ? wp_get_referer() : $proto . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 
    814  
    815813        $login_url = wp_login_url($redirect, true); 
    816814 
    817815        wp_redirect($login_url);