diff --git a/core/urls.php b/core/urls.php index bece4272..f43e08fa 100644 --- a/core/urls.php +++ b/core/urls.php @@ -81,7 +81,7 @@ function make_link(?string $page = null, ?string $query = null, ?string $fragmen * tell the difference between q=foo/bar and q=foo%2Fbar * - REQUEST_URI contains the exact URI that was given to us, so we * can parse it for ourselves - * - generates + * - generates * q=post%2Flist * * This function should always return strings with no leading slashes @@ -104,6 +104,11 @@ function _get_query(?string $uri = null): string $q = $qps[1]; } } + // if we have no slashes, but do have an encoded + // slash, then we _probably_ encoded too much + if(!str_contains($q, "/") && str_contains($q, "%2F")) { + $q = rawurldecode($q); + } } // if we're looking at http://site.com/$INSTALL_DIR/$PAGE,