]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix bug oc-402, check if token is set for a private link
authorMichael Gapczynski <GapczynskiM@gmail.com>
Mon, 7 May 2012 14:47:28 +0000 (10:47 -0400)
committerMichael Gapczynski <GapczynskiM@gmail.com>
Mon, 7 May 2012 14:47:55 +0000 (10:47 -0400)
apps/files_sharing/get.php

index 2b2c9dd07fd0bb6a80029bd78b8c56150a926a82..f430c12a9c203e4a6e64317b0b8c1732120d2680 100755 (executable)
@@ -5,9 +5,7 @@ OCP\JSON::checkAppEnabled('files_sharing');
 require_once 'lib_share.php';
 
 //get the path of the shared file
-$token = $_GET['token'];
-$source = OC_Share::getSource($token);
-if ($source !== false) {
+if (isset($_GET['token']) && $source = OC_Share::getSource($_GET['token'])) {
        // TODO Manipulating the string may not be the best choice. Is there an alternative?
        $user = substr($source, 1, strpos($source, "/", 1) - 1);
        OC_Util::setupFS($user);