Improve goaway legibility

2022.09-rc
Hypolite Petovan 2017-12-17 11:43:30 -05:00
rodzic c238154a6e
commit e74dbb3693
1 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -851,13 +851,15 @@ function killme()
/**
* @brief Redirect to another URL and terminate this process.
*/
function goaway($s)
function goaway($path)
{
if (!strstr(normalise_link($s), "http://")) {
$s = System::baseUrl() . "/" . $s;
if (strstr(normalise_link($path), 'http://')) {
$url = $path;
} else {
$url = System::baseUrl() . '/' . ltrim($path, '/');
}
header("Location: $s");
header("Location: $url");
killme();
}