Improve goaway legibility

This commit is contained in:
Hypolite Petovan 2017-12-17 11:43:30 -05:00
parent c238154a6e
commit e74dbb3693

View file

@ -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();
}