Make WordPress Core

Ticket #25852: 25852.diff

File 25852.diff, 575 bytes (added by mattheu, 12 years ago)
  • src/wp-includes/taxonomy.php

     
    17111711function sanitize_term_field($field, $value, $term_id, $taxonomy, $context) {
    17121712        $int_fields = array( 'parent', 'term_id', 'count', 'term_group', 'term_taxonomy_id', 'object_id' );
    17131713        if ( in_array( $field, $int_fields ) )
    1714                 $value = absint( $value );
     1714                $value = ( $value >= 0 ) ? absint( $value ) : 0;
    17151715
    17161716        if ( 'raw' == $context )
    17171717                return $value;