redirect fixes from mdawaffe. fixes #3342.

git-svn-id: http://svn.automattic.com/wordpress/trunk@4456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-11-08 21:14:53 +00:00
parent 19942073ea
commit bf8e2b03e2
1 changed files with 5 additions and 6 deletions

View File

@ -14,7 +14,7 @@ $update = '';
if ( empty($_POST) ) { if ( empty($_POST) ) {
$referer = '<input type="hidden" name="wp_http_referer" value="'. wp_specialchars(stripslashes($_SERVER['REQUEST_URI'])) . '" />'; $referer = '<input type="hidden" name="wp_http_referer" value="'. wp_specialchars(stripslashes($_SERVER['REQUEST_URI'])) . '" />';
} elseif ( isset($_POST['wp_http_referer']) ) { } elseif ( isset($_POST['wp_http_referer']) ) {
$redirect = remove_query_arg(array('wp_http_referer', 'updated', 'delete_count'), urlencode(stripslashes($_POST['wp_http_referer']))); $redirect = remove_query_arg(array('wp_http_referer', 'updated', 'delete_count'), stripslashes($_POST['wp_http_referer']));
$referer = '<input type="hidden" name="wp_http_referer" value="' . wp_specialchars($redirect) . '" />'; $referer = '<input type="hidden" name="wp_http_referer" value="' . wp_specialchars($redirect) . '" />';
} else { } else {
$redirect = 'users.php'; $redirect = 'users.php';
@ -181,9 +181,8 @@ case 'dodelete':
++$delete_count; ++$delete_count;
} }
$redirect = add_query_arg('delete_count', $delete_count, $redirect); $redirect = add_query_arg( array('delete_count' => $delete_count, 'update' => $update), $redirect);
wp_redirect($redirect);
wp_redirect(add_query_arg('update', $update, $redirect));
break; break;
@ -258,8 +257,8 @@ case 'adduser':
$add_user_errors = $user_id; $add_user_errors = $user_id;
else { else {
$new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_POST['user_login']), true)); $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_POST['user_login']), true));
$redirect = add_query_arg('usersearch', $new_user_login, $redirect); $redirect = add_query_arg( array('usersearch' => urlencode($new_user_login), 'update' => $update), $redirect );
wp_redirect(add_query_arg('update', $update, $redirect) . '#user-' . $user_id); wp_redirect( $redirect . '#user-' . $user_id );
die(); die();
} }