From e3041700cf66a133e287d6ddf33c4490b9e9afe9 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 15 Jun 2026 23:05:27 +0200 Subject: [PATCH] add test to catch URL path extraction not removing query --- tst/RequestTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tst/RequestTest.php b/tst/RequestTest.php index 41794d5c..d7e4d9ac 100644 --- a/tst/RequestTest.php +++ b/tst/RequestTest.php @@ -218,6 +218,7 @@ class RequestTest extends TestCase { $this->reset(); $id = Helper::getRandomId(); + $path = '/' . $this->getRandomQueryChars() . '/'; $queryParams = array($id); $queryParamCount = random_int(1, 5); for ($i = 0; $i < $queryParamCount; ++$i) { @@ -226,8 +227,10 @@ class RequestTest extends TestCase shuffle($queryParams); $_SERVER['REQUEST_METHOD'] = 'GET'; $_SERVER['QUERY_STRING'] = implode('&', $queryParams); + $_SERVER['REQUEST_URI'] = $path . '?' . $_SERVER['QUERY_STRING']; $_GET[$id] = ''; $request = new Request; $this->assertEquals($id, $request->getParam('pasteid')); + $this->assertEquals($path, $request->getRequestUri()); } }