Changes to how we do redirects.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-10-05 08:35:22 +00:00
parent 2d4dd7e6fb
commit c59a8a8119
4 changed files with 5 additions and 1 deletions

View File

@ -86,6 +86,7 @@ case 'update':
$referred = str_replace('?updated=true' , '', $_SERVER['HTTP_REFERER']); $referred = str_replace('?updated=true' , '', $_SERVER['HTTP_REFERER']);
$goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true'; $goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true';
$goback = preg_replace('|[^a-z?=&/~.:_-]|i', '', $goback);
header('Location: ' . $goback); header('Location: ' . $goback);
break; break;

View File

@ -458,6 +458,7 @@ case 'delete':
$sendback = $_SERVER['HTTP_REFERER']; $sendback = $_SERVER['HTTP_REFERER'];
if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php'; if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php';
$sendback = preg_replace('|[^a-z?=&/~.:_-]|i', '', $sendback);
header ('Location: ' . $sendback); header ('Location: ' . $sendback);
do_action('delete_post', $post_id); do_action('delete_post', $post_id);
break; break;

View File

@ -98,6 +98,8 @@ header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-cache, must-revalidate'); header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache'); 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'];
$location = preg_replace('|[^a-z?=&/~.:_-]|i', '', $location);
if ($is_IIS) { if ($is_IIS) {
header("Refresh: 0;url=$location"); header("Refresh: 0;url=$location");
} else { } else {

View File

@ -139,7 +139,7 @@ default:
if( !empty($_POST) ) { if( !empty($_POST) ) {
$log = $_POST['log']; $log = $_POST['log'];
$pwd = $_POST['pwd']; $pwd = $_POST['pwd'];
$redirect_to = preg_replace('|[^a-z/~.:_-]|i', '', $_POST['redirect_to']); $redirect_to = preg_replace('|[^a-z?=&/~.:_-]|i', '', $_POST['redirect_to']);
} }
$user = get_userdatabylogin($log); $user = get_userdatabylogin($log);