==== Patch <fix_1109> level 1
Source: [No source]
Target: 1a063a9b-81f0-0310-95a4-ce76da25c4cd:/trunk:2447 [mirrored]
(http://svn.automattic.com/wordpress/trunk)
Log:
Bug fix for #1109
=== wp-admin/categories.php
==================================================================
|
|
|
|
| 32 | 32 | $category_nicename = sanitize_title($cat_name, $cat_ID); |
| 33 | 33 | $category_description = $_POST['category_description']; |
| 34 | 34 | $cat = intval($_POST['cat']); |
| | 35 | // Let's check if the category already exists |
| 35 | 36 | |
| | 37 | $cur_id = (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE cat_name = '$cat_name'"); |
| | 38 | if ($cur_id>0) |
| | 39 | die(sprintf(__("Cannot create category. Category named '%s' already exists"), $cat_name)); |
| 36 | 40 | $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')"); |
| 37 | 41 | |
| 38 | 42 | header('Location: categories.php?message=1#addcat'); |