Code Duplication    Length = 9-9 lines in 2 locations

wp-includes/bookmark.php 1 location

@@ 321-329 (lines=9) @@
318
		$link_id = $bookmark['link_id'];
319
	}
320
321
	foreach ( $fields as $field ) {
322
		if ( $do_object ) {
323
			if ( isset($bookmark->$field) )
324
				$bookmark->$field = sanitize_bookmark_field($field, $bookmark->$field, $link_id, $context);
325
		} else {
326
			if ( isset($bookmark[$field]) )
327
				$bookmark[$field] = sanitize_bookmark_field($field, $bookmark[$field], $link_id, $context);
328
		}
329
	}
330
331
	return $bookmark;
332
}

wp-includes/taxonomy.php 1 location

@@ 1489-1497 (lines=9) @@
1486
1487
	$term_id = $do_object ? $term->term_id : (isset($term['term_id']) ? $term['term_id'] : 0);
1488
1489
	foreach ( (array) $fields as $field ) {
1490
		if ( $do_object ) {
1491
			if ( isset($term->$field) )
1492
				$term->$field = sanitize_term_field($field, $term->$field, $term_id, $taxonomy, $context);
1493
		} else {
1494
			if ( isset($term[$field]) )
1495
				$term[$field] = sanitize_term_field($field, $term[$field], $term_id, $taxonomy, $context);
1496
		}
1497
	}
1498
1499
	if ( $do_object )
1500
		$term->filter = $context;