X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FHTTPSignature.php;h=ae7e0fe375f14c4ef2e4d61696df855803743e1a;hb=e1863951986ba5be173758324a00652bc5af870c;hp=3936c70fcbcde95e62fec977c122050771e6f58f;hpb=f1bcf1ef66a4fbd2bac1c09332520d95087c9807;p=friendica.git diff --git a/src/Util/HTTPSignature.php b/src/Util/HTTPSignature.php index 3936c70fcb..ae7e0fe375 100644 --- a/src/Util/HTTPSignature.php +++ b/src/Util/HTTPSignature.php @@ -347,12 +347,13 @@ class HTTPSignature if (!empty($gsid)) { $insertFields['gsid'] = $gsid; } - if (!DBA::insert('inbox-status', $insertFields, Database::INSERT_IGNORE)) { + DBA::insert('inbox-status', $insertFields, Database::INSERT_IGNORE); + + $status = DBA::selectFirst('inbox-status', [], ['url' => $url]); + if (empty($status)) { Logger::warning('Unable to insert inbox-status row', $insertFields); return; } - - $status = DBA::selectFirst('inbox-status', [], ['url' => $url]); } if ($success) { @@ -421,7 +422,12 @@ class HTTPSignature */ public static function fetch(string $request, int $uid): array { - $curlResult = self::fetchRaw($request, $uid); + try { + $curlResult = self::fetchRaw($request, $uid); + } catch (\Exception $exception) { + Logger::notice('Error fetching url', ['url' => $request, 'exception' => $exception]); + return []; + } if (empty($curlResult)) { return []; @@ -445,7 +451,7 @@ class HTTPSignature * @param string $request request url * @param integer $uid User id of the requester * @param boolean $binary TRUE if asked to return binary results (file download) (default is "false") - * @param array $opts (optional parameters) assoziative array with: + * @param array $opts (optional parameters) associative array with: * 'accept_content' => supply Accept: header with 'accept_content' as the value * 'timeout' => int Timeout in seconds, default system config value or 60 seconds * 'nobody' => only return the header @@ -621,7 +627,7 @@ class HTTPSignature } if (empty($algorithm)) { - Logger::info('No alagorithm'); + Logger::info('No algorithm'); return false; }