summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-10-03 16:14:34 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-10-03 16:14:54 -0400
commit51321526e2540de455b0757b884bc7967cf0eec8 (patch)
tree80929cff1d1cb876da56c9d113cff36db3f12fc1 /apps
parent2d86258fc36fb0fd490af0f9172a4cae4b033dbc (diff)
downloadnextcloud-server-51321526e2540de455b0757b884bc7967cf0eec8.tar.gz
nextcloud-server-51321526e2540de455b0757b884bc7967cf0eec8.zip
Prevent displaying errors if public link url parameters are incorrect
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/public.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 15377680ab8..59755fe6938 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -36,6 +36,13 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
OC_Util::setupFS($uidOwner);
$fileSource = OC_Filecache::getId($path, '');
if ($fileSource != -1 && ($linkItem = OCP\Share::getItemSharedWithByLink($type, $fileSource, $uidOwner))) {
+ // TODO Fix in the getItems
+ if (!isset($linkItem['item_type']) || $linkItem['item_type'] != $type) {
+ header('HTTP/1.0 404 Not Found');
+ $tmpl = new OCP\Template('', '404', 'guest');
+ $tmpl->printPage();
+ exit();
+ }
if (isset($linkItem['share_with'])) {
// Check password
if (isset($_POST['password'])) {