]> BookStack Code Mirror - bookstack/commitdiff
Fixed sort urls with no params not building full path
authorDan Brown <redacted>
Thu, 27 Apr 2023 12:47:49 +0000 (13:47 +0100)
committerDan Brown <redacted>
Thu, 27 Apr 2023 12:49:22 +0000 (13:49 +0100)
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

index 191eddf4d0596e33c5f5ba7af0a783620a2bda5d..837b7fcfdd0bb9c5904726559a68b0d092a99738 100644 (file)
@@ -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));