diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-09-27 15:16:34 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-10-04 18:13:04 +0200 |
commit | 21cbef0d2cc80228d2a473ccfb6ad5b071f314c7 (patch) | |
tree | 214ccd2c50590fc6c996280797be93e0b1aeae92 /lib/private/server.php | |
parent | 61a9098b7d88656d0297a18c1b7685c04d1c64dc (diff) | |
download | nextcloud-server-21cbef0d2cc80228d2a473ccfb6ad5b071f314c7.tar.gz nextcloud-server-21cbef0d2cc80228d2a473ccfb6ad5b071f314c7.zip |
passesCSRFCheck added to OCP\IRequest
Diffstat (limited to 'lib/private/server.php')
-rw-r--r-- | lib/private/server.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/private/server.php b/lib/private/server.php index 4000f546a3b..73a0cbd6ce6 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -22,6 +22,19 @@ class Server extends SimpleContainer implements IServerContainer { return new ContactsManager(); }); $this->registerService('Request', function($c) { + if (isset($c['urlParams'])) { + $urlParams = $c['urlParams']; + } else { + $urlParams = array(); + } + + if (\OC::$session->exists('requesttoken')) { + $requesttoken = \OC::$session->get('requesttoken'); + } else { + $requesttoken = false; + } + + return new Request( array( 'get' => $_GET, @@ -33,7 +46,9 @@ class Server extends SimpleContainer implements IServerContainer { 'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD'])) ? $_SERVER['REQUEST_METHOD'] : null, - 'urlParams' => $c['urlParams'] + 'params' => $params, + 'urlParams' => $urlParams, + 'requesttoken' => $requesttoken, ) ); }); |