Make sure IDs are >= 0. see #6305

git-svn-id: https://develop.svn.wordpress.org/trunk@7481 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-03-23 00:55:11 +00:00
parent e8088c9af3
commit 24a6304824
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;