summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-05-15 14:33:27 +0200
committerJoas Schilling <coding@schilljs.com>2017-05-15 14:33:27 +0200
commit72c1b248442fb05ef2ef1e8fbf3399cb06188013 (patch)
tree49887a496537c7c3a673d4f7319b04721fae517a /lib/private/AppFramework
parentc56c98183d2c8078c436e9b2e0c4f2a0031b4729 (diff)
downloadnextcloud-server-72c1b248442fb05ef2ef1e8fbf3399cb06188013.tar.gz
nextcloud-server-72c1b248442fb05ef2ef1e8fbf3399cb06188013.zip
Check whether the $_SERVER['REQUEST_*'] vars exist before using them
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
index e420a9dacc0..4e41c946432 100644
--- a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
+++ b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
@@ -246,12 +246,11 @@ class SecurityMiddleware extends Middleware {
);
} else {
if($exception instanceof NotLoggedInException) {
- $url = $this->urlGenerator->linkToRoute(
- 'core.login.showLoginForm',
- [
- 'redirect_url' => $this->request->server['REQUEST_URI'],
- ]
- );
+ $params = [];
+ if (isset($this->request->server['REQUEST_URI'])) {
+ $params['redirect_url'] = $this->request->server['REQUEST_URI'];
+ }
+ $url = $this->urlGenerator->linkToRoute('core.login.showLoginForm', $params);
$response = new RedirectResponse($url);
} else {
$response = new TemplateResponse('core', '403', ['file' => $exception->getMessage()], 'guest');