Code Duplication    Length = 6-6 lines in 2 locations

ecrire/inc/distant.php 2 locations

@@ 1126-1131 (lines=6) @@
1123
			) {
1124
				$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text'));
1125
			}
1126
			if (!$t
1127
				and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m)
1128
				and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext)
1129
			) {
1130
				$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text'));
1131
			}
1132
		}
1133
1134
		// Autre mime/type (ou text/plain avec fichier d'extension inconnue)
@@ 1141-1146 (lines=6) @@
1138
1139
		// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg)
1140
		// On essaie de nouveau avec l'extension
1141
		if (!$t
1142
			and $mime_type != 'text/plain'
1143
			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1144
		) {
1145
			# eviter xxx.3 => 3gp (> SPIP 3)
1146
			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text'));
1147
		}
1148
1149
		if ($t) {