Index: src/wp-includes/taxonomy.php
===================================================================
--- src/wp-includes/taxonomy.php	(revision 26027)
+++ src/wp-includes/taxonomy.php	(working copy)
@@ -1710,8 +1710,11 @@
  */
 function sanitize_term_field($field, $value, $term_id, $taxonomy, $context) {
 	$int_fields = array( 'parent', 'term_id', 'count', 'term_group', 'term_taxonomy_id', 'object_id' );
-	if ( in_array( $field, $int_fields ) )
-		$value = absint( $value );
+	if ( in_array( $field, $int_fields ) ) {
+		$value = (int) $value;
+		if ( $value < 0 )
+			$value = 0;
+	}
 
 	if ( 'raw' == $context )
 		return $value;
Index: tests/phpunit/tests/term.php
===================================================================
--- tests/phpunit/tests/term.php	(revision 26027)
+++ tests/phpunit/tests/term.php	(working copy)
@@ -433,6 +433,9 @@
 		unset( $GLOBALS['wp_taxonomies'][ $random_tax ] );
 	}
 
+	/**
+	 * @ticket 17646
+	 */
 	function test_get_object_terms_types() {
 		$post_id = $this->factory->post->create();
 		$term = wp_insert_term( 'one', $this->taxonomy );
@@ -447,6 +450,18 @@
 		$this->assertInternalType( 'int', $term, 'term' );
 	}
 
+	/**
+	 * @ticket 25852
+	 */
+	function test_sanitize_term_field() {
+		$term = wp_insert_term( 'foo', $this->taxonomy );
+
+		$this->assertEquals( 0, sanitize_term_field( 'parent',  0, $term['term_id'], $this->taxonomy, 'raw' ) );
+		$this->assertEquals( 1, sanitize_term_field( 'parent',  1, $term['term_id'], $this->taxonomy, 'raw' ) );
+		$this->assertEquals( 0, sanitize_term_field( 'parent', -1, $term['term_id'], $this->taxonomy, 'raw' ) );
+		$this->assertEquals( 0, sanitize_term_field( 'parent', '', $term['term_id'], $this->taxonomy, 'raw' ) );
+	}
+
 	private function assertPostHasTerms( $post_id, $expected_term_ids, $taxonomy ) {
 		$assigned_term_ids = wp_get_object_terms( $post_id, $taxonomy, array(
 			'fields' => 'ids'
