diff --git a/helpers/auth.php b/helpers/auth.php index 2f6aea8..a582ba6 100644 --- a/helpers/auth.php +++ b/helpers/auth.php @@ -177,7 +177,8 @@ * @return void */ public function exitWithRedirect($path = "") { - header("Location: " . BASE_URL . $path); + $location = str_replace("//", "/", BASE_URL . $path); + header("Location: $location"); exit(); } } \ No newline at end of file diff --git a/helpers/utils.php b/helpers/utils.php index 82aabb4..ea13ced 100644 --- a/helpers/utils.php +++ b/helpers/utils.php @@ -108,6 +108,11 @@ exit; } + /** + * Calculate app base URL + * + * @return string URL + */ public static function getBaseUrl() { $proto = (!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] == "" || $_SERVER["HTTPS"] == "off") ? "http://" : "https://"; $host = isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "";