From e74dbb36934f24e4ed7f2b38a386919060a180bd Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 17 Dec 2017 11:43:30 -0500 Subject: [PATCH] Improve goaway legibility --- boot.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index d786295587..be97cab757 100644 --- a/boot.php +++ b/boot.php @@ -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(); } -- 2.39.5