]> git.mxchange.org Git - friendica.git/commitdiff
Remove $_SERVER superglobal dependency from Profile::addVisitorCookieForHTTPSigner
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 29 Sep 2023 07:09:09 +0000 (03:09 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 3 Oct 2023 23:58:52 +0000 (19:58 -0400)
src/Model/Profile.php
src/Module/Photo.php

index b80c83881adda94b03b4788306bbcd476d7a3019..9c7aab54ad6aa1b59ed4f3e079415b562f08ad17 100644 (file)
@@ -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 [];
                }
index c8e0656d2df62ac9014697cdabd14a636ad73526..be2408edf21c94f70be6bbc1493d1522c045f1bd 100644 (file)
@@ -77,7 +77,7 @@ class Photo extends BaseApi
                        throw new NotModifiedException();
                }
 
-               Profile::addVisitorCookieForHTTPSigner();
+               Profile::addVisitorCookieForHTTPSigner($this->server);
 
                $customsize = 0;
                $square_resize = true;