From bc1e8fd75501498b2997e4d8871d0058264cdb08 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 23 Mar 2008 00:55:11 +0000 Subject: [PATCH] Make sure IDs are >= 0. see #6305 git-svn-id: http://svn.automattic.com/wordpress/trunk@7481 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 035567c0e7..abd471e885 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -796,8 +796,11 @@ function sanitize_term($term, $taxonomy, $context = 'display') { * @return mixed sanitized field */ function sanitize_term_field($field, $value, $term_id, $taxonomy, $context) { - if ( 'parent' == $field || 'term_id' == $field || 'count' == $field || 'term_group' == $field ) + if ( 'parent' == $field || 'term_id' == $field || 'count' == $field || 'term_group' == $field ) { $value = (int) $value; + if ( $value < 0 ) + $value = 0; + } if ( 'raw' == $context ) return $value;