WordPress.org

Make WordPress Core

Ticket #3166: wp_redirect_fix.diff

File wp_redirect_fix.diff, 730 bytes (added by leflo, 8 years ago)
  • wp-includes/pluggable.php

     
    257257// Cookie safe redirect.  Works around IIS Set-Cookie bug. 
    258258// http://support.microsoft.com/kb/q176113/ 
    259259if ( !function_exists('wp_redirect') ) : 
    260 function wp_redirect($location) { 
     260function wp_redirect($location, $status = 302) { 
    261261        global $is_IIS; 
    262262 
    263263        $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location); 
     
    266266        $strip = array('%0d', '%0a'); 
    267267        $location = str_replace($strip, '', $location); 
    268268 
     269        status_header($status); 
     270 
    269271        if ($is_IIS) 
    270272                header("Refresh: 0;url=$location"); 
    271273        else