mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-10 15:08:28 +03:00
Resolve #878
This commit is contained in:
parent
271065fe44
commit
5b1404ffac
1 changed files with 8 additions and 6 deletions
|
|
@ -40,12 +40,14 @@ abstract class MimeType
|
|||
\fclose($fp);
|
||||
}
|
||||
if ('application/zip' === \str_replace('/x-', '/', $mime)) {
|
||||
$zip = new \ZipArchive($filename);
|
||||
if (false !== $zip->locateName('word/_rels/document.xml.rels')) {
|
||||
return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
||||
}
|
||||
if (false !== $zip->locateName('xl/_rels/workbook.xml.rels')) {
|
||||
return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
||||
$zip = new \ZipArchive();
|
||||
if ($zip->open($filename, \ZIPARCHIVE::RDONLY)) {
|
||||
if (false !== $zip->locateName('word/_rels/document.xml.rels')) {
|
||||
return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
||||
}
|
||||
if (false !== $zip->locateName('xl/_rels/workbook.xml.rels')) {
|
||||
return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue