mirror of
https://github.com/friendica/friendica
synced 2024-12-22 18:00:16 +00:00
fix erros in Util namespace
This commit is contained in:
parent
c74ed3d2b9
commit
e97231683a
4 changed files with 7 additions and 11 deletions
|
@ -109,9 +109,9 @@ class NotifyMailBuilder extends MailBuilder
|
|||
public function withPhoto(string $image, string $link, string $name)
|
||||
{
|
||||
$this->photo = [
|
||||
'image' => $image ?? '',
|
||||
'link' => $link ?? '',
|
||||
'name' => $name ?? '',
|
||||
'image' => $image,
|
||||
'link' => $link,
|
||||
'name' => $name,
|
||||
];
|
||||
|
||||
return $this;
|
||||
|
|
|
@ -478,10 +478,6 @@ class HTTPSignature
|
|||
return [];
|
||||
}
|
||||
|
||||
if (empty($curlResult)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!$curlResult->isSuccess() || empty($curlResult->getBodyString())) {
|
||||
Logger::debug('Fetching was unsuccessful', ['url' => $request, 'return-code' => $curlResult->getReturnCode(), 'error-number' => $curlResult->getErrorNumber(), 'error' => $curlResult->getError()]);
|
||||
return [];
|
||||
|
|
|
@ -308,13 +308,13 @@ class Images
|
|||
|
||||
$data = DI::cache()->get($cacheKey);
|
||||
|
||||
if (empty($data) || !is_array($data)) {
|
||||
if (!is_array($data)) {
|
||||
$data = self::getInfoFromURL($url, $ocr);
|
||||
|
||||
DI::cache()->set($cacheKey, $data);
|
||||
}
|
||||
|
||||
return $data ?? [];
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -370,7 +370,7 @@ class Images
|
|||
|
||||
if ($image->isValid()) {
|
||||
$data['blurhash'] = $image->getBlurHash();
|
||||
|
||||
|
||||
if ($ocr) {
|
||||
$media = ['img_str' => $img_str];
|
||||
Hook::callAll('ocr-detection', $media);
|
||||
|
|
|
@ -1087,7 +1087,7 @@ class ParseUrl
|
|||
$content = JsonLD::fetchElement($jsonld, 'logo', 'url', '@type', 'ImageObject');
|
||||
if (!empty($content) && is_string($content)) {
|
||||
$jsonldinfo['publisher_img'] = trim($content);
|
||||
} elseif (!empty($content) && is_array($content)) {
|
||||
} elseif (is_array($content) && array_key_exists(0, $content)) {
|
||||
$jsonldinfo['publisher_img'] = trim($content[0]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue