File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
lib/private/AppFramework/Http
tests/lib/AppFramework/Http Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,9 @@ public function __get($name) {
256256 : null ;
257257 case 'parameters ' :
258258 case 'params ' :
259+ if ($ this ->content === false ) {
260+ return $ this ->items ['parameters ' ];
261+ }
259262 return $ this ->getContent ();
260263 default :
261264 return isset ($ this [$ name ])
Original file line number Diff line number Diff line change @@ -332,6 +332,37 @@ public function testPutStream() {
332332 $ this ->fail ('Expected LogicException. ' );
333333 }
334334
335+ public function testDoubleGetParamOnPut () {
336+ $ vars = [
337+ 'method ' => 'PUT ' ,
338+ 'server ' => [],
339+ ];
340+
341+ $ request = new Request (
342+ $ vars ,
343+ $ this ->secureRandom ,
344+ $ this ->config ,
345+ $ this ->csrfTokenManager ,
346+ $ this ->stream
347+ );
348+
349+ // trigger decoding of the request
350+ $ request ->getParam ('foo ' );
351+
352+ $ request ->setUrlParameters ([
353+ 'var1 ' => 'value1 ' ,
354+ 'var2 ' => 'value2 '
355+ ]);
356+
357+ // it should be possible to get unlimited number of URL parameters
358+ // without reading the request body
359+ $ var1 = $ request ->getParam ('var1 ' );
360+ $ var2 = $ request ->getParam ('var2 ' );
361+
362+ $ this ->assertEquals ('value1 ' , $ var1 );
363+ $ this ->assertEquals ('value2 ' , $ var2 );
364+ }
365+
335366 public function testSetUrlParameters () {
336367 $ vars = [
337368 'post ' => [],
You can’t perform that action at this time.
0 commit comments