Merge pull request #14509 from owncloud/fix/14231

Show 404 page when accessing empty share URL
This commit is contained in:
Lukas Reschke 2015-02-25 21:39:49 +01:00
commit 94bf2c8d6d
1 changed files with 7 additions and 1 deletions

View File

@ -25,4 +25,10 @@ $urlGenerator = new \OC\URLGenerator(\OC::$server->getConfig());
$token = isset($_GET['t']) ? $_GET['t'] : '';
$route = isset($_GET['download']) ? 'files_sharing.sharecontroller.downloadShare' : 'files_sharing.sharecontroller.showShare';
OC_Response::redirect($urlGenerator->linkToRoute($route, array('token' => $token)));
if($token !== '') {
OC_Response::redirect($urlGenerator->linkToRoute($route, array('token' => $token)));
} else {
header('HTTP/1.0 404 Not Found');
$tmpl = new OCP\Template('', '404', 'guest');
print_unescaped($tmpl->fetchPage());
}