Code Duplication    Length = 4-4 lines in 2 locations

src/wp-admin/includes/media.php 1 location

@@ 694-697 (lines=4) @@
691
		if ( $post != $_post )
692
			wp_update_post($post);
693
694
		foreach ( get_attachment_taxonomies($post) as $t ) {
695
			if ( isset($attachment[$t]) )
696
				wp_set_object_terms($attachment_id, array_map('trim', preg_split('/,+/', $attachment[$t])), $t, false);
697
		}
698
	}
699
700
	if ( isset($_POST['insert-gallery']) || isset($_POST['update-gallery']) ) { ?>

src/wp-admin/includes/ajax-actions.php 1 location

@@ 2547-2550 (lines=4) @@
2544
2545
	wp_update_post( $post );
2546
2547
	foreach ( get_attachment_taxonomies( $post ) as $taxonomy ) {
2548
		if ( isset( $attachment_data[ $taxonomy ] ) )
2549
			wp_set_object_terms( $id, array_map( 'trim', preg_split( '/,+/', $attachment_data[ $taxonomy ] ) ), $taxonomy, false );
2550
	}
2551
2552
	if ( ! $attachment = wp_prepare_attachment_for_js( $id ) )
2553
		wp_send_json_error();