Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 782-784 (lines=3) @@
779
				$html = "<a href='" . esc_url($src) . "'>$title</a>";
780
781
			$type = 'file';
782
			if ( ( $ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src ) ) && ( $ext_type = wp_ext2type( $ext ) )
783
				&& ( 'audio' == $ext_type || 'video' == $ext_type ) )
784
					$type = $ext_type;
785
786
			/**
787
			 * Filters the URL sent to the editor for a specific media type.

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

@@ 2757-2759 (lines=3) @@
2754
2755
	// Figure out what filter to run:
2756
	$type = 'file';
2757
	if ( ( $ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src ) ) && ( $ext_type = wp_ext2type( $ext ) )
2758
		&& ( 'audio' == $ext_type || 'video' == $ext_type ) )
2759
			$type = $ext_type;
2760
2761
	/** This filter is documented in wp-admin/includes/media.php */
2762
	$html = apply_filters( "{$type}_send_to_editor_url", $html, $src, $link_text );