Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-02-25 19:26:54 +0300
committerLukas Reschke <lukas@owncloud.com>2015-02-25 19:29:12 +0300
commitfca4628a5c7b9e56d8c3c195fb1fd1c7eeb1c262 (patch)
tree5a3a9d5a36e4e50b15d9eb19ce562b762a381ab4 /apps/files_sharing/public.php
parent14c592fe865748f38dd6ee31634d053f83a8e791 (diff)
Show 404 page when accessing empty share URL
Testplan: - [ ] Without: Accessing `public.php?service=files&t=` throws an exception - [ ] With: No exception thrown and 404 page displayed. Fixes https://github.com/owncloud/core/issues/14231
Diffstat (limited to 'apps/files_sharing/public.php')
-rw-r--r--apps/files_sharing/public.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 028c6da12f9..ebc5b7bda45 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -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());
+}