Remove $_SERVER superglobal dependency from Profile::addVisitorCookieForHTTPSigner

This commit is contained in:
Hypolite Petovan 2023-09-29 03:09:09 -04:00
parent 6d009a3e0f
commit e01040a2e8
2 changed files with 6 additions and 4 deletions

View 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 [];
}

View file

@ -77,7 +77,7 @@ class Photo extends BaseApi
throw new NotModifiedException();
}
Profile::addVisitorCookieForHTTPSigner();
Profile::addVisitorCookieForHTTPSigner($this->server);
$customsize = 0;
$square_resize = true;