[FIX] HTTPS errors in Tracy

This commit is contained in:
Alma Armas 2021-01-04 17:38:17 +00:00
parent 5291fa345e
commit 8b1bc4b894
2 changed files with 6 additions and 4 deletions

View file

@ -40,8 +40,9 @@ class Club extends RowModel
function getAvatarUrl(): string
{
$serverUrl = "http" . ($_SERVER["HTTPS"] === "on" ? "s" : "") . "://";
$serverUrl .= $_SERVER["HTTP_HOST"];
$url = ((!empty($_SERVER['HTTPS'])) ? 'https' : 'http') . '://' . $_SERVER['SERVER_NAME'] . '/';
$url = explode('?', $url);
$serverUrl = $url[0];
$avPhoto = $this->getAvatarPhoto();
return is_null($avPhoto) ? "$serverUrl/assets/packages/static/openvk/img/camera_200.png" : $avPhoto->getURL();

View file

@ -94,8 +94,9 @@ class User extends RowModel
function getAvatarUrl(): string
{
$serverUrl = "http" . ($_SERVER["HTTPS"] === "on" ? "s" : "") . "://";
$serverUrl .= $_SERVER["HTTP_HOST"];
$url = ((!empty($_SERVER['HTTPS'])) ? 'https' : 'http') . '://' . $_SERVER['SERVER_NAME'] . '/';
$url = explode('?', $url);
$serverUrl = $url[0];
if($this->getRecord()->deleted)
return "$serverUrl/assets/packages/static/openvk/img/camera_200.png";