[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 function getAvatarUrl(): string
{ {
$serverUrl = "http" . ($_SERVER["HTTPS"] === "on" ? "s" : "") . "://"; $url = ((!empty($_SERVER['HTTPS'])) ? 'https' : 'http') . '://' . $_SERVER['SERVER_NAME'] . '/';
$serverUrl .= $_SERVER["HTTP_HOST"]; $url = explode('?', $url);
$serverUrl = $url[0];
$avPhoto = $this->getAvatarPhoto(); $avPhoto = $this->getAvatarPhoto();
return is_null($avPhoto) ? "$serverUrl/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();

View file

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