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:
parent
f6716ad1e3
commit
54e1b16a80
@ -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
Block a user