diff --git a/wp-admin/b2menutop.txt b/wp-admin/b2menutop.txt index e8b9519be..6372660d9 100644 --- a/wp-admin/b2menutop.txt +++ b/wp-admin/b2menutop.txt @@ -2,7 +2,7 @@ 1 edit.php Edit 3 b2team.php Team 4 wp-options.php Options -3 b2categories.php Categories +3 categories.php Categories 4 b2template.php Template 5 linkmanager.php Manage Links *** diff --git a/wp-admin/b2categories.php b/wp-admin/categories.php similarity index 76% rename from wp-admin/b2categories.php rename to wp-admin/categories.php index c9422aa8a..8f3afa4d2 100644 --- a/wp-admin/b2categories.php +++ b/wp-admin/categories.php @@ -41,15 +41,16 @@ case 'addcat': $standalone = 1; require_once('b2header.php'); - + if ($user_level < 3) die ('Cheatin’ uh?'); - $cat_name=addslashes($HTTP_POST_VARS["cat_name"]); - - $wpdb->query("INSERT INTO $tablecategories (cat_ID,cat_name) VALUES ('0', '$cat_name')"); + $cat_name= addslashes(stripslashes(stripslashes($HTTP_POST_VARS['cat_name']))); + $category_nicename = sanitize_title($cat_name); - header('Location: b2categories.php'); + $wpdb->query("INSERT INTO $tablecategories (cat_ID, cat_name, category_nicename) VALUES ('0', '$cat_name', '$category_nicename')"); + + header('Location: categories.php'); break; @@ -69,27 +70,27 @@ case 'Delete': die ('Cheatin’ uh?'); $wpdb->query("DELETE FROM $tablecategories WHERE cat_ID = $cat_ID"); - $wpdb->query("UPDATE $tableposts SET post_category='1' WHERE post_category='$cat_ID'"); + $wpdb->query("UPDATE $tablepost2cat SET category_id='1' WHERE category_id='$cat_ID'"); - header('Location: b2categories.php'); + header('Location: categories.php'); break; case 'Rename': require_once ('b2header.php'); - $cat_name = get_catname($HTTP_POST_VARS["cat_ID"]); - $cat_name = addslashes($cat_name); + $cat_name = get_catname($HTTP_POST_VARS['cat_ID']); + $cat_name = stripslashes($cat_name); ?>
Old name:
-