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

git-svn-id: https://develop.svn.wordpress.org/trunk@7483 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-03-23 01:10:46 +00:00
parent f6716ad1e3
commit 54e1b16a80
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;