Fix double slash in URL, closes #50
This commit is contained in:
parent
f1bc4b137f
commit
153a174930
@ -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();
|
||||
}
|
||||
}
|
@ -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"] : "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user