Fix double slash in URL, closes #50
This commit is contained in:
parent
f1bc4b137f
commit
153a174930
@ -177,7 +177,8 @@
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exitWithRedirect($path = "") {
|
public function exitWithRedirect($path = "") {
|
||||||
header("Location: " . BASE_URL . $path);
|
$location = str_replace("//", "/", BASE_URL . $path);
|
||||||
|
header("Location: $location");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -108,6 +108,11 @@
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate app base URL
|
||||||
|
*
|
||||||
|
* @return string URL
|
||||||
|
*/
|
||||||
public static function getBaseUrl() {
|
public static function getBaseUrl() {
|
||||||
$proto = (!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] == "" || $_SERVER["HTTPS"] == "off") ? "http://" : "https://";
|
$proto = (!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] == "" || $_SERVER["HTTPS"] == "off") ? "http://" : "https://";
|
||||||
$host = isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "";
|
$host = isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user