From: Michael Gapczynski Date: Mon, 7 May 2012 14:47:28 +0000 (-0400) Subject: Fix bug oc-402, check if token is set for a private link X-Git-Tag: v4.0.0beta~1^2~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=71423ec566e77d28dd923b91aa311b600987a6ea;p=nextcloud-server.git Fix bug oc-402, check if token is set for a private link --- diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php index 2b2c9dd07fd..f430c12a9c2 100755 --- a/apps/files_sharing/get.php +++ b/apps/files_sharing/get.php @@ -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);