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