|
@@ 1099-1104 (lines=6) @@
|
| 1096 |
|
) { |
| 1097 |
|
$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
| 1098 |
|
} |
| 1099 |
|
if (!$t |
| 1100 |
|
and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m) |
| 1101 |
|
and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 1102 |
|
) { |
| 1103 |
|
$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
| 1104 |
|
} |
| 1105 |
|
} |
| 1106 |
|
|
| 1107 |
|
// Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
|
@@ 1114-1119 (lines=6) @@
|
| 1111 |
|
|
| 1112 |
|
// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
| 1113 |
|
// On essaie de nouveau avec l'extension |
| 1114 |
|
if (!$t |
| 1115 |
|
and $mime_type != 'text/plain' |
| 1116 |
|
and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1117 |
|
) { |
| 1118 |
|
# eviter xxx.3 => 3gp (> SPIP 3) |
| 1119 |
|
$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
| 1120 |
|
} |
| 1121 |
|
|
| 1122 |
|
if ($t) { |