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:
parent
31d303ea1b
commit
a4589fb866
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue