Changeset 7481

Show
Ignore:
Timestamp:
03/23/08 00:55:11 (10 months ago)
Author:
ryan
Message:

Make sure IDs are >= 0. see #6305

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/taxonomy.php

    r7431 r7481  
    797797 */ 
    798798function sanitize_term_field($field, $value, $term_id, $taxonomy, $context) { 
    799     if ( 'parent' == $field  || 'term_id' == $field || 'count' == $field || 'term_group' == $field ) 
     799    if ( 'parent' == $field  || 'term_id' == $field || 'count' == $field || 'term_group' == $field ) { 
    800800        $value = (int) $value; 
     801        if ( $value < 0 ) 
     802            $value = 0; 
     803    } 
    801804 
    802805    if ( 'raw' == $context )