Code Duplication    Length = 7-8 lines in 2 locations

wp-includes/formatting.php 1 location

@@ 1800-1806 (lines=7) @@
1797
1798
		if ( preg_match("/^[a-zA-Z]{2,5}\d?$/", $part) ) {
1799
			$allowed = false;
1800
			foreach ( $mimes as $ext_preg => $mime_match ) {
1801
				$ext_preg = '!^(' . $ext_preg . ')$!i';
1802
				if ( preg_match( $ext_preg, $part ) ) {
1803
					$allowed = true;
1804
					break;
1805
				}
1806
			}
1807
			if ( !$allowed )
1808
				$filename .= '_';
1809
		}

wp-includes/media.php 1 location

@@ 3285-3292 (lines=8) @@
3282
	$exts = array_merge( wp_get_audio_extensions(), wp_get_video_extensions() );
3283
	$mimes = get_allowed_mime_types();
3284
	$ext_mimes = array();
3285
	foreach ( $exts as $ext ) {
3286
		foreach ( $mimes as $ext_preg => $mime_match ) {
3287
			if ( preg_match( '#' . $ext . '#i', $ext_preg ) ) {
3288
				$ext_mimes[ $ext ] = $mime_match;
3289
				break;
3290
			}
3291
		}
3292
	}
3293
3294
	$has_audio = $wpdb->get_var( "
3295
		SELECT ID