diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-12 15:02:19 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-12 15:02:19 +0200 |
commit | e7fa2790f39a5c120d4f935139c1210258a1472a (patch) | |
tree | 3d75f1433893ea15b52d9757e19f0c6d09e68dcf /lib/private/server.php | |
parent | 266325eac451fc92d4d390d1f9b97362c317445a (diff) | |
download | nextcloud-server-e7fa2790f39a5c120d4f935139c1210258a1472a.tar.gz nextcloud-server-e7fa2790f39a5c120d4f935139c1210258a1472a.zip |
Correctly process request parameters other than GET or POST, dont use globals in the class but inject it
Diffstat (limited to 'lib/private/server.php')
-rw-r--r-- | lib/private/server.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/server.php b/lib/private/server.php index 3517d7b3548..5d90a0b19fc 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -35,6 +35,13 @@ class Server extends SimpleContainer implements IServerContainer { $requesttoken = false; } + if (defined('PHPUNIT_RUN') && PHPUNIT_RUN + && in_array('fakeinput', stream_get_wrappers())) { + $stream = 'fakeinput://data'; + } else { + $stream = 'php://input'; + } + return new Request( array( 'get' => $_GET, @@ -48,7 +55,7 @@ class Server extends SimpleContainer implements IServerContainer { : null, 'urlParams' => $urlParams, 'requesttoken' => $requesttoken, - ) + ), $stream ); }); $this->registerService('PreviewManager', function($c) { |