mirror of
https://github.com/friendica/friendica
synced 2025-04-26 10:30:11 +00:00
A lot of Fixings
This commit is contained in:
parent
06371d29a6
commit
65ca164487
7 changed files with 16 additions and 25 deletions
|
@ -90,7 +90,7 @@ class Link
|
|||
$curlResult = DI::httpRequest()->head($url, ['timeout' => $timeout]);
|
||||
if ($curlResult->isSuccess()) {
|
||||
if (empty($media['mimetype'])) {
|
||||
return $curlResult->getHeader('Content-Type');
|
||||
return $curlResult->getHeader('Content-Type')[0] ?? '';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
|
|
|
@ -170,10 +170,10 @@ class Media
|
|||
$curlResult = DI::httpRequest()->head($media['url'], ['timeout' => $timeout]);
|
||||
if ($curlResult->isSuccess()) {
|
||||
if (empty($media['mimetype'])) {
|
||||
$media['mimetype'] = $curlResult->getHeader('Content-Type');
|
||||
$media['mimetype'] = $curlResult->getHeader('Content-Type')[0] ?? '';
|
||||
}
|
||||
if (empty($media['size'])) {
|
||||
$media['size'] = (int)$curlResult->getHeader('Content-Length');
|
||||
$media['size'] = (int)$curlResult->getHeader('Content-Length')[0] ?? 0;
|
||||
}
|
||||
} else {
|
||||
Logger::notice('Could not fetch head', ['media' => $media]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue