mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Always return absolute URLs for avatars
This commit is contained in:
parent
a67241c5da
commit
a608ebc1a7
2 changed files with 10 additions and 5 deletions
|
@ -40,9 +40,11 @@ class Club extends RowModel
|
|||
|
||||
function getAvatarUrl(): string
|
||||
{
|
||||
$avPhoto = $this->getAvatarPhoto();
|
||||
$serverUrl = "http" . ($_SERVER["HTTPS"] === "on" ? "s" : "") . "://";
|
||||
$serverUrl .= $_SERVER["HTTP_HOST"];
|
||||
$avPhoto = $this->getAvatarPhoto();
|
||||
|
||||
return is_null($avPhoto) ? "/assets/packages/static/openvk/img/camera_200.png" : $avPhoto->getURL();
|
||||
return is_null($avPhoto) ? "$serverUrl/assets/packages/static/openvk/img/camera_200.png" : $avPhoto->getURL();
|
||||
}
|
||||
|
||||
function getAvatarLink(): string
|
||||
|
|
|
@ -94,14 +94,17 @@ class User extends RowModel
|
|||
|
||||
function getAvatarUrl(): string
|
||||
{
|
||||
$serverUrl = "http" . ($_SERVER["HTTPS"] === "on" ? "s" : "") . "://";
|
||||
$serverUrl .= $_SERVER["HTTP_HOST"];
|
||||
|
||||
if($this->getRecord()->deleted)
|
||||
return "/assets/packages/static/openvk/img/camera_200.png";
|
||||
return "$serverUrl/assets/packages/static/openvk/img/camera_200.png";
|
||||
else if($this->isBanned())
|
||||
return "/assets/packages/static/openvk/img/banned.jpg";
|
||||
return "$serverUrl/assets/packages/static/openvk/img/banned.jpg";
|
||||
|
||||
$avPhoto = $this->getAvatarPhoto();
|
||||
if(is_null($avPhoto))
|
||||
return "/assets/packages/static/openvk/img/camera_200.png";
|
||||
return "$serverUrl/assets/packages/static/openvk/img/camera_200.png";
|
||||
else
|
||||
return $avPhoto->getURL();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue