Ticket #13909: 13909.patch
File 13909.patch, 1.7 KB (added by , 13 years ago) |
---|
-
wp-includes/pluggable.php
871 871 * @param int $status Status code to use 872 872 * @return bool False if $location is not set 873 873 */ 874 function wp_redirect( $location, $status = 302) {874 function wp_redirect( $location, $status = 302 ) { 875 875 global $is_IIS; 876 876 877 $location = apply_filters( 'wp_redirect', $location, $status);878 $status = apply_filters('wp_redirect_status', $status, $location);877 $location = apply_filters( 'wp_redirect', $location, $status ); 878 $status = apply_filters( 'wp_redirect_status', $status, $location ); 879 879 880 880 if ( !$location ) // allows the wp_redirect filter to cancel a redirect 881 881 return false; 882 882 883 $location = wp_sanitize_redirect( $location);883 $location = wp_sanitize_redirect( $location ); 884 884 885 885 if ( $is_IIS ) { 886 header( "Refresh: 0;url=$location");886 header( "Refresh: 0;url=$location" ); 887 887 } else { 888 888 if ( php_sapi_name() != 'cgi-fcgi' ) 889 889 status_header($status); // This causes problems on IIS and some FastCGI setups 890 header( "Location: $location", true, $status);890 header( "Location: $location", true, $status ); 891 891 } 892 893 $status = (int) $status; 894 $method = $_SERVER['REQUEST_METHOD']; 895 $html = 'HEAD' !== $method && (301 === $status || 302 === $status || 303 === $status || 307 === $status); 896 if ( $html ) { 897 898 ?> 899 <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> 900 <TITLE><?php echo $status; ?> Moved</TITLE></HEAD><BODY> 901 <H1><?php echo $status; ?> Moved</H1> 902 The document has moved 903 <A HREF="<?php echo esc_attr( $location ); ?>">here</A>. 904 </BODY></HTML> 905 <?php 906 } 892 907 } 893 908 endif; 894 909