This commit is contained in:
Philipp 2021-08-20 20:03:42 +02:00
parent a338e4cbff
commit 06371d29a6
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
5 changed files with 19 additions and 14 deletions

View file

@ -492,17 +492,17 @@ class Photo
if (!empty($image_url)) {
$ret = DI::httpRequest()->get($image_url);
$img_str = $ret->getBody();
$contType = $ret->getContentType();
$type = $ret->getContentType();
} else {
$img_str = '';
$contType = '';
$type = '';
}
if ($quit_on_error && ($img_str == "")) {
return false;
}
$type = Images::getMimeTypeByData($img_str, $image_url, $contType);
$type = Images::getMimeTypeByData($img_str, $image_url, $type);
$Image = new Image($img_str, $type);
if ($Image->isValid()) {

View file

@ -1095,13 +1095,13 @@ class User
$curlResult = DI::httpRequest()->get($photo);
if ($curlResult->isSuccess()) {
$img_str = $curlResult->getBody();
$contType = $curlResult->getContentType();
$type = $curlResult->getContentType();
} else {
$img_str = '';
$contType = '';
$type = '';
}
$type = Images::getMimeTypeByData($img_str, $photo, $contType);
$type = Images::getMimeTypeByData($img_str, $photo, $type);
$Image = new Image($img_str, $type);
if ($Image->isValid()) {