diff --git a/fp-includes/core/core.cookie.php b/fp-includes/core/core.cookie.php index bf435e9..79b79e5 100644 --- a/fp-includes/core/core.cookie.php +++ b/fp-includes/core/core.cookie.php @@ -26,37 +26,6 @@ if ( !defined('COOKIE_DOMAIN') ) } -// Cookie safe redirect. Works around IIS Set-Cookie bug. -// http://support.microsoft.com/kb/q176113/ -if ( !function_exists('wp_redirect') ) : -function wp_redirect($location, $status = 302) { - global $is_IIS; - - $location = apply_filters('wp_redirect', $location, $status); - - if ( !$location ) // allows the wp_redirect filter to cancel a redirect - return false; - - $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location); - # $location = wp_kses_no_null($location); - - $location = preg_replace('/\0+/', '', $location); - $location = preg_replace('/(\\\\0)+/', '', $location); - - - $strip = array('%0d', '%0a'); - $location = str_replace($strip, '', $location); - - if ( $is_IIS ) { - header("Refresh: 0;url=$location"); - } else { - if ( php_sapi_name() != 'cgi-fcgi' ) - status_header($status); // This causes problems on IIS and some FastCGI setups - header("Location: $location"); - } -} -endif; - if ( !function_exists('wp_get_cookie_login') ): function wp_get_cookie_login() { if ( empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE]) ) diff --git a/fp-includes/core/core.utils.php b/fp-includes/core/core.utils.php index 6381639..d83d930 100644 --- a/fp-includes/core/core.utils.php +++ b/fp-includes/core/core.utils.php @@ -236,8 +236,8 @@ if (!function_exists('fnmatch')) { if (!$absolute_path) $location = BLOG_BASEURL . $location; - - header("Location: $location"); + + wp_redirect($location); exit(); } diff --git a/fp-includes/core/core.wp-pluggable-funcs.php b/fp-includes/core/core.wp-pluggable-funcs.php index f10122c..2997fc6 100755 --- a/fp-includes/core/core.wp-pluggable-funcs.php +++ b/fp-includes/core/core.wp-pluggable-funcs.php @@ -247,16 +247,35 @@ endif; // Cookie safe redirect. Works around IIS Set-Cookie bug. // http://support.microsoft.com/kb/q176113/ if ( !function_exists('wp_redirect') ) : -function wp_redirect($location) { +function wp_redirect($location, $status = 302) { global $is_IIS; - if ($is_IIS) + $location = apply_filters('wp_redirect', $location, $status); + + if ( !$location ) // allows the wp_redirect filter to cancel a redirect + return false; + + $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location); + # $location = wp_kses_no_null($location); + + $location = preg_replace('/\0+/', '', $location); + $location = preg_replace('/(\\\\0)+/', '', $location); + + + $strip = array('%0d', '%0a'); + $location = str_replace($strip, '', $location); + + if ( $is_IIS ) { header("Refresh: 0;url=$location"); - else + } else { + if ( php_sapi_name() != 'cgi-fcgi' ) + utils_status_header($status); // This causes problems on IIS and some FastCGI setups header("Location: $location"); + } } endif; + if ( !function_exists('wp_setcookie') ) : function wp_setcookie($username, $password, $already_md5 = false, $home = '', $siteurl = '') { if ( !$already_md5 )