|
@@ 959-964 (lines=6) @@
|
| 956 |
|
) { |
| 957 |
|
$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
| 958 |
|
} |
| 959 |
|
if (!$t |
| 960 |
|
and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m) |
| 961 |
|
and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 962 |
|
) { |
| 963 |
|
$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
| 964 |
|
} |
| 965 |
|
} |
| 966 |
|
|
| 967 |
|
// Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
|
@@ 974-979 (lines=6) @@
|
| 971 |
|
|
| 972 |
|
// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
| 973 |
|
// On essaie de nouveau avec l'extension |
| 974 |
|
if (!$t |
| 975 |
|
and $mime_type != 'text/plain' |
| 976 |
|
and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 977 |
|
) { |
| 978 |
|
# eviter xxx.3 => 3gp (> SPIP 3) |
| 979 |
|
$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
| 980 |
|
} |
| 981 |
|
|
| 982 |
|
if ($t) { |