]> BookStack Code Mirror - bookstack/blobdiff - app/helpers.php
Fixed sort urls with no params not building full path
[bookstack] / 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));