mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Workaround #1392
This commit is contained in:
parent
e4f3df3bb9
commit
34e4bad77f
2 changed files with 6 additions and 3 deletions
|
|
@ -10,8 +10,8 @@ class AvatarsPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
NAME = 'Avatars',
|
NAME = 'Avatars',
|
||||||
AUTHOR = 'SnappyMail',
|
AUTHOR = 'SnappyMail',
|
||||||
URL = 'https://snappymail.eu/',
|
URL = 'https://snappymail.eu/',
|
||||||
VERSION = '1.12',
|
VERSION = '1.13',
|
||||||
RELEASE = '2023-11-27',
|
RELEASE = '2024-01-16',
|
||||||
REQUIRED = '2.25.0',
|
REQUIRED = '2.25.0',
|
||||||
CATEGORY = 'Contacts',
|
CATEGORY = 'Contacts',
|
||||||
LICENSE = 'MIT',
|
LICENSE = 'MIT',
|
||||||
|
|
@ -316,7 +316,7 @@ class AvatarsPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
if ($aFiles) {
|
if ($aFiles) {
|
||||||
\MailSo\Base\Http::setLastModified(\filemtime($aFiles[0]));
|
\MailSo\Base\Http::setLastModified(\filemtime($aFiles[0]));
|
||||||
return [
|
return [
|
||||||
\mime_content_type($aFiles[0]),
|
\SnappyMail\File\MimeType::fromFile($aFiles[0]),
|
||||||
\file_get_contents($aFiles[0])
|
\file_get_contents($aFiles[0])
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@ abstract class MimeType
|
||||||
if (self::$finfo) {
|
if (self::$finfo) {
|
||||||
$mime = \preg_replace('#[,;].*#', '', self::$finfo->file($filename));
|
$mime = \preg_replace('#[,;].*#', '', self::$finfo->file($filename));
|
||||||
}
|
}
|
||||||
|
if (!$mime && \is_callable('mime_content_type')) {
|
||||||
|
$mime = \mime_content_type($filename);
|
||||||
|
}
|
||||||
if (!$mime && $fp = \fopen($filename, 'rb')) {
|
if (!$mime && $fp = \fopen($filename, 'rb')) {
|
||||||
$mime = self::fromStream($fp);
|
$mime = self::fromStream($fp);
|
||||||
\fclose($fp);
|
\fclose($fp);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue