From 647ce6c237457aa69135ca80849b8ef0fdfc5b7a Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Thu, 27 Apr 2023 13:47:49 +0100 Subject: [PATCH] Fixed sort urls with no params not building full path The provided partial path would be return which may not resolve to the full URL when used on systems like those hosting BookStack on a sub-path. Fixes #4201 --- app/helpers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers.php b/app/helpers.php index 191eddf4d..837b7fcfd 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -147,7 +147,7 @@ function icon(string $name, array $attrs = []): string } /** - * Generate a url with multiple parameters for sorting purposes. + * Generate a URL with multiple parameters for sorting purposes. * Works out the logic to set the correct sorting direction * Discards empty parameters and allows overriding. */ @@ -172,7 +172,7 @@ function sortUrl(string $path, array $data, array $overrideData = []): string } if (count($queryStringSections) === 0) { - return $path; + return url($path); } return url($path . '?' . implode('&', $queryStringSections));