Introducing wp_redirect(), first cut. http://mosquito.wordpress.org/view.php?id=592 Props: Toby Simmons

git-svn-id: http://svn.automattic.com/wordpress/trunk@2436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-03-13 16:36:09 +00:00
parent 3825b18aff
commit 8b36e6be3a
8 changed files with 21 additions and 9 deletions

View File

@ -243,7 +243,7 @@ switch ($action) {
WHERE link_id=$link_id");
} // end if save
setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600);
header('Location: ' . $this_file);
wp_redirect($this_file);
break;
} // end Save
@ -267,7 +267,7 @@ switch ($action) {
}
$links_show_cat_id = $cat_id;
setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600);
header('Location: '.$this_file);
wp_redirect($this_file);
break;
} // end Delete

View File

@ -84,7 +84,7 @@ case 'update':
$referred = remove_query_arg('updated' , $_SERVER['HTTP_REFERER']);
$goback = add_query_arg('updated', 'true', $_SERVER['HTTP_REFERER']);
$goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback);
header('Location: ' . $goback);
wp_redirect($goback);
break;
default:

View File

@ -86,7 +86,7 @@ case 'update':
$result = $wpdb->query("UPDATE $wpdb->users SET user_firstname='$newuser_firstname', $updatepassword user_lastname='$newuser_lastname', user_nickname='$newuser_nickname', user_icq='$newuser_icq', user_email='$newuser_email', user_url='$newuser_url', user_aim='$newuser_aim', user_msn='$newuser_msn', user_yim='$newuser_yim', user_idmode='$newuser_idmode', user_description = '$user_description', user_nicename = '$newuser_nicename' WHERE ID = $user_ID");
header('Location: profile.php?updated=true');
wp_redirect('profile.php?updated=true');
break;
case 'IErightclick':

View File

@ -52,6 +52,5 @@ header('Pragma: no-cache');
$location = (empty($_POST['redirect_to'])) ? $_SERVER["HTTP_REFERER"] : $_POST['redirect_to'];
header("Location: $location");
wp_redirect($location);
?>

View File

@ -1711,6 +1711,19 @@ function auth_redirect() {
}
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) {
global $is_IIS;
if ($is_IIS)
header("Refresh: 0;url=$location");
else
header("Location: $location");
}
endif;
function is_plugin_page() {
global $plugin_page;

View File

@ -35,6 +35,7 @@ $is_IE = (($is_macIE) || ($is_winIE));
// Server detection
$is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;
$is_IIS = strstr($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') ? 1 : 0;
// if the config file does not provide the smilies array, let's define it here
if (!isset($wpsmiliestrans)) {

View File

@ -184,7 +184,7 @@ default:
wp_setcookie($user_login, $user_pass);
}
do_action('wp_login', $user_login);
header("Location: $redirect_to");
wp_redirect($redirect_to);
exit();
} else {
if ($using_cookie)

View File

@ -7,6 +7,5 @@ if ( get_magic_quotes_gpc() )
// 10 days
setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
header('Location: ' . $_SERVER['HTTP_REFERER']);
wp_redirect($_SERVER['HTTP_REFERER']);
?>