diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-02-23 14:07:42 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-02-23 14:07:42 +0100 |
commit | 615bc5a827f8d397ce75e3efb3341cee2f542e02 (patch) | |
tree | 2f789e8b8034a69ae06fe7cd0aa9c2ed318666ca /public.php | |
parent | f693d439e24c1d59c0de2347d6c9888c852cfafe (diff) | |
download | nextcloud-server-615bc5a827f8d397ce75e3efb3341cee2f542e02.tar.gz nextcloud-server-615bc5a827f8d397ce75e3efb3341cee2f542e02.zip |
Use `getParam` instead of `server`
`server` is completely wrong here and this will not work on master. With `getParam` it will work fine though.
Testplan:
- [ ] Without patch: Share a file and try to access `http://localhost/public.php?service=files&t=THESHAREDTOKEN` => Fails
- [ ] With patch: Try the same => Works
Master only.
Diffstat (limited to 'public.php')
-rw-r--r-- | public.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/public.php b/public.php index f17052a6c87..76fe5ac0570 100644 --- a/public.php +++ b/public.php @@ -15,11 +15,12 @@ try { OC::checkSingleUserMode(); $request = \OC::$server->getRequest(); $pathInfo = $request->getPathInfo(); - if (!$pathInfo && !isset($request->server['service'])) { + + if (!$pathInfo && $request->getParam('service', '') === '') { header('HTTP/1.0 404 Not Found'); exit; - } elseif (isset($request->server['service'])) { - $service = $request->server['service']; + } elseif ($request->getParam('service', '')) { + $service = $request->getParam('service', ''); } else { $pathInfo = trim($pathInfo, '/'); list($service) = explode('/', $pathInfo); |