Code Duplication    Length = 12-13 lines in 2 locations

classes/fields/file.php 2 locations

@@ 423-434 (lines=12) @@
420
				} else {
421
					$found = false;
422
423
					foreach ( $mime_types as $type => $mime ) {
424
						if ( false !== strpos( $type, $limit_type ) ) {
425
							$mime = explode( '/', $mime );
426
							$mime = $mime[0];
427
428
							if ( ! in_array( $mime, $new_limit_types, true ) ) {
429
								$new_limit_types[] = $mime;
430
							}
431
432
							$found = true;
433
						}
434
					}
435
436
					if ( ! $found ) {
437
						$new_limit_types[] = $limit_type;
@@ 1094-1106 (lines=13) @@
1091
				foreach ( $limit_types as $k => $limit_type ) {
1092
					$found = false;
1093
1094
					foreach ( $mime_types as $type => $mime ) {
1095
						if ( 0 === strpos( $mime, $limit_type ) ) {
1096
							$type = explode( '|', $type );
1097
1098
							foreach ( $type as $t ) {
1099
								if ( ! in_array( $t, $new_limit_types, true ) ) {
1100
									$new_limit_types[] = $t;
1101
								}
1102
							}
1103
1104
							$found = true;
1105
						}
1106
					}
1107
1108
					if ( ! $found ) {
1109
						$new_limit_types[] = $limit_type;