From 443ba120022a773b9e6d5c774b18c6da4ba37c7e Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 9 Feb 2024 10:50:07 +0000 Subject: [PATCH] test encoding --- core/tests/UtilTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/tests/UtilTest.php b/core/tests/UtilTest.php index 7fa13806..deaeca5c 100644 --- a/core/tests/UtilTest.php +++ b/core/tests/UtilTest.php @@ -184,5 +184,13 @@ class UtilTest extends TestCase // niceurl root $_SERVER["REQUEST_URI"] = "/test/"; $this->assertEquals("/", _get_query()); + + // niceurls with encoded slashes + $_SERVER["REQUEST_URI"] = "/test/post/list/tasty%2Fcake/1"; + $this->assertEquals("/post/list/tasty%2Fcake/1", _get_query()); + + // query string with encoded slashes + $_SERVER["REQUEST_URI"] = "/test/index.php?q=/post/list/tasty%2Fcake/1"; + $this->assertEquals("/post/list/tasty%2Fcake/1", _get_query()); } }