]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prevent displaying errors if public link url parameters are incorrect
authorMichael Gapczynski <mtgap@owncloud.com>
Wed, 3 Oct 2012 20:14:34 +0000 (16:14 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Wed, 3 Oct 2012 20:14:54 +0000 (16:14 -0400)
apps/files_sharing/public.php

index 15377680ab8034e71e34fd39a242a2ba4fc38e49..59755fe693875241239a8701f189661b27e9127d 100644 (file)
@@ -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'])) {