mirror of
https://github.com/friendica/friendica
synced 2024-11-19 18:23:41 +00:00
Merge pull request #10949 from annando/photo-octet
Accept photo fetching for octet-stream as well
This commit is contained in:
commit
af8114af37
1 changed files with 8 additions and 4 deletions
|
@ -289,13 +289,17 @@ class Photo extends BaseModule
|
||||||
$mimetext = '';
|
$mimetext = '';
|
||||||
if (!empty($url)) {
|
if (!empty($url)) {
|
||||||
$mime = ParseUrl::getContentType($url);
|
$mime = ParseUrl::getContentType($url);
|
||||||
if (empty($mime) || ($mime[0] != 'image')) {
|
if (!empty($mime)) {
|
||||||
$url = '';
|
|
||||||
} else {
|
|
||||||
$mimetext = $mime[0] . '/' . $mime[1];
|
$mimetext = $mime[0] . '/' . $mime[1];
|
||||||
|
} else {
|
||||||
|
Logger::info('Invalid file', ['url' => $url]);
|
||||||
|
}
|
||||||
|
if (!empty($mimetext) && ($mime[0] != 'image') && ($mimetext != 'application/octet-stream')) {
|
||||||
|
Logger::info('Unexpected Content-Type', ['mime' => $mimetext, 'url' => $url]);
|
||||||
|
$mimetext = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($url)) {
|
if (empty($mimetext)) {
|
||||||
if ($customsize <= Proxy::PIXEL_MICRO) {
|
if ($customsize <= Proxy::PIXEL_MICRO) {
|
||||||
$url = Contact::getDefaultAvatar($contact, Proxy::SIZE_MICRO);
|
$url = Contact::getDefaultAvatar($contact, Proxy::SIZE_MICRO);
|
||||||
} elseif ($customsize <= Proxy::PIXEL_THUMB) {
|
} elseif ($customsize <= Proxy::PIXEL_THUMB) {
|
||||||
|
|
Loading…
Reference in a new issue