From: Dan Brown Date: Thu, 27 Apr 2023 12:47:49 +0000 (+0100) Subject: Fixed sort urls with no params not building full path X-Git-Tag: v23.05~1^2~13 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/647ce6c237457aa69135ca80849b8ef0fdfc5b7a 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 --- 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));