]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check if file source exists before searching for link
authorMichael Gapczynski <mtgap@owncloud.com>
Thu, 30 Aug 2012 00:40:12 +0000 (20:40 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Thu, 30 Aug 2012 01:12:23 +0000 (21:12 -0400)
apps/files_sharing/public.php

index 7f72ef81bd3f68884f27a290e2d9ae8aa3905f2e..010f6b9de1822a9dec43da52f332d8f7440dfef0 100644 (file)
@@ -6,9 +6,8 @@ if (isset($_GET['file'])) {
        $uidOwner = substr($_GET['file'], 1, $pos - 1);
        if (OCP\User::userExists($uidOwner)) {
                OC_Util::setupFS($uidOwner);
-               $file = substr($_GET['file'], $pos);
                $fileSource = OC_Filecache::getId($_GET['file'], '');
-               if ($linkItem = OCP\Share::getItemSharedWithByLink('file', $fileSource, $uidOwner)) {
+               if ($fileSource != -1 && ($linkItem = OCP\Share::getItemSharedWithByLink('file', $fileSource, $uidOwner))) {
                        if (isset($linkItem['share_with'])) {
                                // Check password
                                if (isset($_POST['password'])) {