mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-07-17 16:39:40 +00:00
add test to catch URL path extraction not removing query
This commit is contained in:
parent
597a6f0d12
commit
e3041700cf
1 changed files with 3 additions and 0 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue