From bc4468c5ab3ae9a3d76ade89777d12a90d8fcaf5 Mon Sep 17 00:00:00 2001 From: Pablo Ferreiro Date: Tue, 29 Mar 2022 19:37:57 +0200 Subject: [PATCH] Reverting APP_PATH to APP_URL --- app/Helpers/Misc.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/Helpers/Misc.php b/app/Helpers/Misc.php index 2619287..c685607 100644 --- a/app/Helpers/Misc.php +++ b/app/Helpers/Misc.php @@ -2,10 +2,6 @@ namespace App\Helpers; class Misc { - static private function isSecure() { - return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443; - } - static public function getCursor(): int { return isset($_GET['cursor']) && is_numeric($_GET['cursor']) ? (int) $_GET['cursor'] : 0; } @@ -15,9 +11,7 @@ class Misc { } static public function url(string $endpoint = ''): string { - $protocol = self::isSecure() ? 'https' : 'http'; - $root = $protocol . '://' . $_SERVER['HTTP_HOST']; - return $root . self::env('APP_PATH', '') . $endpoint; + return self::env('APP_URL', '') . $endpoint; } static public function env(string $key, $default_value) {