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:
parent
3825b18aff
commit
8b36e6be3a
|
@ -243,7 +243,7 @@ switch ($action) {
|
||||||
WHERE link_id=$link_id");
|
WHERE link_id=$link_id");
|
||||||
} // end if save
|
} // end if save
|
||||||
setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600);
|
setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600);
|
||||||
header('Location: ' . $this_file);
|
wp_redirect($this_file);
|
||||||
break;
|
break;
|
||||||
} // end Save
|
} // end Save
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ switch ($action) {
|
||||||
}
|
}
|
||||||
$links_show_cat_id = $cat_id;
|
$links_show_cat_id = $cat_id;
|
||||||
setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600);
|
setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600);
|
||||||
header('Location: '.$this_file);
|
wp_redirect($this_file);
|
||||||
break;
|
break;
|
||||||
} // end Delete
|
} // end Delete
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ case 'update':
|
||||||
$referred = remove_query_arg('updated' , $_SERVER['HTTP_REFERER']);
|
$referred = remove_query_arg('updated' , $_SERVER['HTTP_REFERER']);
|
||||||
$goback = add_query_arg('updated', 'true', $_SERVER['HTTP_REFERER']);
|
$goback = add_query_arg('updated', 'true', $_SERVER['HTTP_REFERER']);
|
||||||
$goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback);
|
$goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback);
|
||||||
header('Location: ' . $goback);
|
wp_redirect($goback);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -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");
|
$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;
|
break;
|
||||||
|
|
||||||
case 'IErightclick':
|
case 'IErightclick':
|
||||||
|
|
|
@ -52,6 +52,5 @@ header('Pragma: no-cache');
|
||||||
|
|
||||||
$location = (empty($_POST['redirect_to'])) ? $_SERVER["HTTP_REFERER"] : $_POST['redirect_to'];
|
$location = (empty($_POST['redirect_to'])) ? $_SERVER["HTTP_REFERER"] : $_POST['redirect_to'];
|
||||||
|
|
||||||
header("Location: $location");
|
wp_redirect($location);
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -1711,6 +1711,19 @@ function auth_redirect() {
|
||||||
}
|
}
|
||||||
endif;
|
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() {
|
function is_plugin_page() {
|
||||||
global $plugin_page;
|
global $plugin_page;
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ $is_IE = (($is_macIE) || ($is_winIE));
|
||||||
|
|
||||||
// Server detection
|
// Server detection
|
||||||
$is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;
|
$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 the config file does not provide the smilies array, let's define it here
|
||||||
if (!isset($wpsmiliestrans)) {
|
if (!isset($wpsmiliestrans)) {
|
||||||
|
|
|
@ -184,7 +184,7 @@ default:
|
||||||
wp_setcookie($user_login, $user_pass);
|
wp_setcookie($user_login, $user_pass);
|
||||||
}
|
}
|
||||||
do_action('wp_login', $user_login);
|
do_action('wp_login', $user_login);
|
||||||
header("Location: $redirect_to");
|
wp_redirect($redirect_to);
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
if ($using_cookie)
|
if ($using_cookie)
|
||||||
|
|
|
@ -7,6 +7,5 @@ if ( get_magic_quotes_gpc() )
|
||||||
// 10 days
|
// 10 days
|
||||||
setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
|
setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
|
||||||
|
|
||||||
header('Location: ' . $_SERVER['HTTP_REFERER']);
|
wp_redirect($_SERVER['HTTP_REFERER']);
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue