|
@@ 507-512 (lines=6) @@
|
| 504 |
|
){ |
| 505 |
|
$t = sql_fetsel("extension", "spip_types_documents", "extension=" . sql_quote($rext[1],'','text')); |
| 506 |
|
} |
| 507 |
|
if (!$t |
| 508 |
|
AND preg_match(",^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims", $headers, $m) |
| 509 |
|
AND preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 510 |
|
){ |
| 511 |
|
$t = sql_fetsel("extension", "spip_types_documents", "extension=" . sql_quote($rext[1],'','text')); |
| 512 |
|
} |
| 513 |
|
} |
| 514 |
|
|
| 515 |
|
// Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
|
@@ 521-526 (lines=6) @@
|
| 518 |
|
|
| 519 |
|
// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
| 520 |
|
// On essaie de nouveau avec l'extension |
| 521 |
|
if (!$t |
| 522 |
|
AND $mime_type!='text/plain' |
| 523 |
|
AND preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 524 |
|
){ |
| 525 |
|
$t = sql_fetsel("extension", "spip_types_documents", "extension=" . sql_quote($rext[1],'','text')); # eviter xxx.3 => 3gp (> SPIP 3) |
| 526 |
|
} |
| 527 |
|
|
| 528 |
|
|
| 529 |
|
if ($t){ |