From: Hypolite Petovan Date: Fri, 29 Sep 2023 07:09:09 +0000 (-0400) Subject: Remove $_SERVER superglobal dependency from Profile::addVisitorCookieForHTTPSigner X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e01040a2e8d5658ef116e9606f2f383f8f3ea1db;p=friendica.git Remove $_SERVER superglobal dependency from Profile::addVisitorCookieForHTTPSigner --- diff --git a/src/Model/Profile.php b/src/Model/Profile.php index b80c83881a..9c7aab54ad 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -813,12 +813,14 @@ class Profile /** * Set the visitor cookies (see remote_user()) for signed HTTP requests - ( + * + * @param array $server The content of the $_SERVER superglobal * @return array Visitor contact array + * @throws InternalServerErrorException */ - public static function addVisitorCookieForHTTPSigner(): array + public static function addVisitorCookieForHTTPSigner(array $server): array { - $requester = HTTPSignature::getSigner('', $_SERVER); + $requester = HTTPSignature::getSigner('', $server); if (empty($requester)) { return []; } diff --git a/src/Module/Photo.php b/src/Module/Photo.php index c8e0656d2d..be2408edf2 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -77,7 +77,7 @@ class Photo extends BaseApi throw new NotModifiedException(); } - Profile::addVisitorCookieForHTTPSigner(); + Profile::addVisitorCookieForHTTPSigner($this->server); $customsize = 0; $square_resize = true;