Preserve query string when redirecting.

This commit is contained in:
flash 2023-01-07 19:05:25 +00:00
parent 8e04a2162c
commit 811e2ffd1d
2 changed files with 8 additions and 2 deletions

@ -1 +1 @@
Subproject commit fbe4fe18decd502a0ca15ffe8a7c3b2d847349d5
Subproject commit 30064e6891d3d06abe0174b921dc505ff74f4300

View file

@ -30,7 +30,13 @@ $router->get('/:id', function($response, $request, $id) use ($db) {
if(!$info->next())
return 404;
$response->redirect($info->getString(0));
$targetUrl = $info->getString(0);
$params = $request->getParamString();
if(!empty($params))
$targetUrl .= '?' . $params;
$response->redirect($targetUrl);
});
$router->dispatch();