mirror of
https://github.com/friendica/friendica
synced 2024-12-23 03:20:15 +00:00
Merge pull request #12604 from nupplaphil/bug/marco_r
Some Bugfixings (thx to Marco R.)
This commit is contained in:
commit
0ab5fed64c
2 changed files with 6 additions and 2 deletions
|
@ -62,10 +62,14 @@ class ExternalResource implements ICanReadFromStorage
|
|||
if (!empty($fetchResult) && $fetchResult->isSuccess()) {
|
||||
Logger::debug('Got picture', ['Content-Type' => $fetchResult->getHeader('Content-Type'), 'uid' => $data->uid, 'url' => $data->url]);
|
||||
return $fetchResult->getBody();
|
||||
} else {
|
||||
if (empty($fetchResult)) {
|
||||
throw new ReferenceStorageException(sprintf('External resource failed to get %s', $reference));
|
||||
} else {
|
||||
throw new ReferenceStorageException(sprintf('External resource failed to get %s', $reference), $fetchResult->getReturnCode(), new Exception($fetchResult->getBody()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
|
|
|
@ -126,7 +126,7 @@ class Link
|
|||
$timeout = DI::config()->get('system', 'xrd_timeout');
|
||||
|
||||
$curlResult = HTTPSignature::fetchRaw($url, 0, [HttpClientOptions::TIMEOUT => $timeout, HttpClientOptions::ACCEPT_CONTENT => $accept]);
|
||||
if (!$curlResult->isSuccess()) {
|
||||
if (empty($curlResult) || !$curlResult->isSuccess()) {
|
||||
return [];
|
||||
}
|
||||
$fields = ['mimetype' => $curlResult->getHeader('Content-Type')[0]];
|
||||
|
|
Loading…
Reference in a new issue