WordPress.org

Make WordPress Core

Ticket #4918: wp_redirect.v2.diff

File wp_redirect.v2.diff, 756 bytes (added by chmac, 7 years ago)

Patch v2 - dependent on PHP version >= 4.3.0

  • trunk/wp-includes/pluggable.php

     
    417417        if ( $is_IIS ) { 
    418418                header("Refresh: 0;url=$location"); 
    419419        } else { 
    420                 if ( php_sapi_name() != 'cgi-fcgi' ) 
    421                         status_header($status); // This causes problems on IIS and some FastCGI setups 
    422                 header("Location: $location"); 
     420                if ( version_compare( phpversion(), '4.3.0', '>=' ) ) { 
     421                        header("Location: $location",null,$status); 
     422                } else { 
     423                        if ( php_sapi_name() != 'cgi-fcgi' ) 
     424                                status_header($status); // This causes problems on IIS and some FastCGI setups 
     425                        header("Location: $location"); 
     426                } 
    423427        } 
    424428} 
    425429endif;