From 615bc5a827f8d397ce75e3efb3341cee2f542e02 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Mon, 23 Feb 2015 14:07:42 +0100 Subject: Use `getParam` instead of `server` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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. --- public.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'public.php') 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); -- cgit v1.2.3