fix erros in Util namespace

This commit is contained in:
Art4 2024-11-16 17:16:26 +00:00
parent c74ed3d2b9
commit e97231683a
4 changed files with 7 additions and 11 deletions

View file

@ -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;

View file

@ -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 [];

View file

@ -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;
}
/**

View file

@ -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]);
}