Make sure IDs are >= 0. see #6305

git-svn-id: http://svn.automattic.com/wordpress/trunk@7481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-03-23 00:55:11 +00:00
parent da305bbce0
commit bc1e8fd755
1 changed files with 4 additions and 1 deletions

View File

@ -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;