From 0039aafe94129dbe82d20600d81ed0069f0715ce Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 2 Apr 2020 22:38:50 +0100 Subject: [PATCH] avoid excess ampersands --- core/urls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/urls.php b/core/urls.php index c095e15b..7e1f58cc 100644 --- a/core/urls.php +++ b/core/urls.php @@ -38,7 +38,7 @@ function make_link(?string $page=null, ?string $query=null, ?string $fragment=nu $parts['path'] = "$install_dir/$page"; } else { $parts['path'] = "$install_dir/index.php"; - $query = "q=$page&$query"; + $query = empty($query) ? "q=$page" : "q=$page&$query"; } $parts['query'] = $query; // http_build_query($query); $parts['fragment'] = $fragment; // http_build_query($hash);