X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/449d082fcc4873c1f7d363a0d9f7409be7f6e77d..refs/tags/wordpress-2.8.3-scripts:/wp-admin/categories.php?ds=inline diff --git a/wp-admin/categories.php b/wp-admin/categories.php index e7042480..8d26b9e1 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -25,11 +25,11 @@ case 'addcat': if ( !current_user_can('manage_categories') ) wp_die(__('Cheatin’ uh?')); - if( wp_insert_category($_POST ) ) { - wp_redirect('categories.php?message=1#addcat'); - } else { - wp_redirect('categories.php?message=4#addcat'); - } + if ( wp_insert_category($_POST ) ) + wp_safe_redirect( add_query_arg( 'message', 1, wp_get_referer() ) . '#addcat' ); + else + wp_safe_redirect( add_query_arg( 'message', 4, wp_get_referer() ) . '#addcat' ); + exit; break; @@ -40,15 +40,15 @@ case 'delete': if ( !current_user_can('manage_categories') ) wp_die(__('Cheatin’ uh?')); - $cat_name = get_catname($cat_ID); + $cat_name = get_cat_name($cat_ID); // Don't delete the default cats. - if ( $cat_ID == get_option('default_category') ) + if ( $cat_ID == get_option('default_category') ) wp_die(sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name)); wp_delete_category($cat_ID); - wp_redirect('categories.php?message=2'); + wp_safe_redirect( add_query_arg( 'message', 2, wp_get_referer() ) ); exit; break; @@ -60,7 +60,7 @@ case 'bulk-delete': wp_die( __('You are not allowed to delete categories.') ); foreach ( (array) $_GET['delete'] as $cat_ID ) { - $cat_name = get_catname($cat_ID); + $cat_name = get_cat_name($cat_ID); // Don't delete the default cats. if ( $cat_ID == get_option('default_category') ) @@ -69,9 +69,7 @@ case 'bulk-delete': wp_delete_category($cat_ID); } - $sendback = wp_get_referer(); - - wp_redirect($sendback); + wp_safe_redirect( wp_get_referer() ); exit(); break; @@ -131,9 +129,9 @@ $messages[5] = __('Category not updated.');
Note:
Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.'), apply_filters('the_category', get_catname(get_option('default_category')))) ?>
Note:
Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?>
category to tag converter.'), 'admin.php?import=wp-cat2tag') ?>