File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,9 @@ public static function createFromEnvironment(Environment $env)
218218
219219 // Query string
220220 $ queryString = $ env ->get ('QUERY_STRING ' , '' );
221+ if ($ queryString === '' ) {
222+ $ queryString = parse_url ('http://example.com ' . $ env ->get ('REQUEST_URI ' ), PHP_URL_QUERY );
223+ }
221224
222225 // Fragment
223226 $ fragment = '' ;
Original file line number Diff line number Diff line change @@ -632,4 +632,16 @@ public function testRequestURIContainsIndexDotPhp()
632632 );
633633 $ this ->assertSame ('/foo/index.php ' , $ uri ->getBasePath ());
634634 }
635+
636+ public function testRequestURICanContainParams ()
637+ {
638+ $ uri = Uri::createFromEnvironment (
639+ Environment::mock (
640+ [
641+ 'REQUEST_URI ' => '/foo?abc=123 ' ,
642+ ]
643+ )
644+ );
645+ $ this ->assertEquals ('abc=123 ' , $ uri ->getQuery ());
646+ }
635647}
You can’t perform that action at this time.
0 commit comments