backport of post-redirect exit() fixes from [4467] and [4468]

git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2006-11-15 22:23:43 +00:00
parent 0c771d5595
commit 27da557de4
5 changed files with 20 additions and 7 deletions

View File

@ -33,6 +33,7 @@ case 'addcat':
wp_insert_category($_POST); wp_insert_category($_POST);
wp_redirect('categories.php?message=1#addcat'); wp_redirect('categories.php?message=1#addcat');
exit;
break; break;
case 'delete': case 'delete':
@ -51,7 +52,7 @@ case 'delete':
wp_delete_category($cat_ID); wp_delete_category($cat_ID);
wp_redirect('categories.php?message=2'); wp_redirect('categories.php?message=2');
exit;
break; break;
case 'edit': case 'edit':
@ -106,6 +107,7 @@ case 'editedcat':
wp_update_category($_POST); wp_update_category($_POST);
wp_redirect('categories.php?message=3'); wp_redirect('categories.php?message=3');
exit;
break; break;
default: default:

View File

@ -63,6 +63,7 @@ switch ($action) {
$q = $wpdb->query("update $wpdb->links SET link_owner='$newowner' WHERE link_id IN ($all_links)"); $q = $wpdb->query("update $wpdb->links SET link_owner='$newowner' WHERE link_id IN ($all_links)");
wp_redirect($this_file); wp_redirect($this_file);
exit;
break; break;
} }
case 'visibility': case 'visibility':
@ -100,6 +101,7 @@ switch ($action) {
} }
wp_redirect($this_file); wp_redirect($this_file);
exit;
break; break;
} }
case 'move': case 'move':
@ -120,6 +122,7 @@ switch ($action) {
$q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)"); $q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)");
wp_redirect($this_file); wp_redirect($this_file);
exit();
break; break;
} }
@ -130,6 +133,7 @@ switch ($action) {
add_link(); add_link();
wp_redirect(wp_get_referer() . '?added=true'); wp_redirect(wp_get_referer() . '?added=true');
exit;
break; break;
} // end Add } // end Add
@ -151,6 +155,7 @@ switch ($action) {
setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600); setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600);
wp_redirect($this_file); wp_redirect($this_file);
exit;
break; break;
} // end Save } // end Save
@ -174,6 +179,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);
wp_redirect($this_file); wp_redirect($this_file);
exit;
break; break;
} // end Delete } // end Delete

View File

@ -338,7 +338,7 @@ case 'editedcomment':
$location = ( empty($_POST['referredby']) ? "edit.php?p=$comment_post_ID&c=1" : $_POST['referredby'] ) . '#comment-' . $comment_ID; $location = ( empty($_POST['referredby']) ? "edit.php?p=$comment_post_ID&c=1" : $_POST['referredby'] ) . '#comment-' . $comment_ID;
$location = apply_filters('comment_edit_redirect', $location, $comment_ID); $location = apply_filters('comment_edit_redirect', $location, $comment_ID);
wp_redirect($location); wp_redirect($location);
exit();
break; break;
default: default:

View File

@ -15,6 +15,7 @@ case 'promote':
if (empty($_POST['users'])) { if (empty($_POST['users'])) {
wp_redirect('users.php'); wp_redirect('users.php');
exit();
} }
if ( !current_user_can('edit_users') ) if ( !current_user_can('edit_users') )
@ -34,6 +35,7 @@ case 'promote':
} }
wp_redirect('users.php?update=' . $update); wp_redirect('users.php?update=' . $update);
exit();
break; break;
@ -43,6 +45,7 @@ case 'dodelete':
if ( empty($_POST['users']) ) { if ( empty($_POST['users']) ) {
wp_redirect('users.php'); wp_redirect('users.php');
exit();
} }
if ( !current_user_can('edit_users') ) if ( !current_user_can('edit_users') )
@ -67,15 +70,17 @@ case 'dodelete':
} }
wp_redirect('users.php?update=' . $update); wp_redirect('users.php?update=' . $update);
exit();
break; break;
case 'delete': case 'delete':
check_admin_referer('bulk-users'); check_admin_referer('bulk-users');
if ( empty($_POST['users']) ) if ( empty($_POST['users']) ) {
wp_redirect('users.php'); wp_redirect('users.php');
exit();
}
if ( !current_user_can('edit_users') ) if ( !current_user_can('edit_users') )
$error['edit_users'] = __('You can’t delete users.'); $error['edit_users'] = __('You can’t delete users.');
@ -137,7 +142,7 @@ case 'adduser':
if ( count($errors) == 0 ) { if ( count($errors) == 0 ) {
wp_redirect('users.php?update=add'); wp_redirect('users.php?update=add');
die(); exit();
} }
default: default:

View File

@ -2,7 +2,7 @@
// This just holds the version number, in a separate file so we can bump it without cluttering the SVN // This just holds the version number, in a separate file so we can bump it without cluttering the SVN
$wp_version = '2.0.5'; $wp_version = '2.0.5.1-beta-1';
$wp_db_version = 3441; $wp_db_version = 3441;
?> ?>