Remove $_SERVER superglobal dependency from Profile::addVisitorCookieForHTTPSigner
This commit is contained in:
parent
6d009a3e0f
commit
e01040a2e8
2 changed files with 6 additions and 4 deletions
|
@ -813,12 +813,14 @@ class Profile
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the visitor cookies (see remote_user()) for signed HTTP requests
|
* 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
|
* @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)) {
|
if (empty($requester)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ class Photo extends BaseApi
|
||||||
throw new NotModifiedException();
|
throw new NotModifiedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile::addVisitorCookieForHTTPSigner();
|
Profile::addVisitorCookieForHTTPSigner($this->server);
|
||||||
|
|
||||||
$customsize = 0;
|
$customsize = 0;
|
||||||
$square_resize = true;
|
$square_resize = true;
|
||||||
|
|
Loading…
Reference in a new issue