|
@@ 669-674 (lines=6) @@
|
| 666 |
|
){ |
| 667 |
|
$t = sql_fetsel("extension", "spip_types_documents", "extension=" . sql_quote($rext[1],'','text')); |
| 668 |
|
} |
| 669 |
|
if (!$t |
| 670 |
|
AND preg_match(",^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims", $headers, $m) |
| 671 |
|
AND preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 672 |
|
){ |
| 673 |
|
$t = sql_fetsel("extension", "spip_types_documents", "extension=" . sql_quote($rext[1],'','text')); |
| 674 |
|
} |
| 675 |
|
} |
| 676 |
|
|
| 677 |
|
// Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
|
@@ 683-688 (lines=6) @@
|
| 680 |
|
|
| 681 |
|
// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
| 682 |
|
// On essaie de nouveau avec l'extension |
| 683 |
|
if (!$t |
| 684 |
|
AND $mime_type!='text/plain' |
| 685 |
|
AND preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 686 |
|
){ |
| 687 |
|
$t = sql_fetsel("extension", "spip_types_documents", "extension=" . sql_quote($rext[1],'','text')); # eviter xxx.3 => 3gp (> SPIP 3) |
| 688 |
|
} |
| 689 |
|
|
| 690 |
|
|
| 691 |
|
if ($t){ |