Make sure cat parents are >= 0. see #6305

git-svn-id: http://svn.automattic.com/wordpress/trunk@7483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-03-23 01:10:46 +00:00
parent 31d303ea1b
commit a4589fb866
1 changed files with 3 additions and 0 deletions

View File

@ -76,6 +76,9 @@ function wp_insert_category($catarr, $wp_error = false) {
$parent = $category_parent;
$parent = (int) $parent;
if ( $parent < 0 )
$parent = 0;
if ( empty($parent) || !category_exists( $parent ) || ($cat_ID && cat_is_ancestor_of($cat_ID, $parent) ) )
$parent = 0;