From d4271ed9dfef9a31f34bf91b8d854cbc5be0c67d Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Mon, 14 May 2012 17:30:32 -0400 Subject: [PATCH] Use original source when resharing a file, fixes bug oc-210 --- apps/files_sharing/lib_share.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php index 02e4b6e4c2..73ddaf0b9e 100755 --- a/apps/files_sharing/lib_share.php +++ b/apps/files_sharing/lib_share.php @@ -41,6 +41,10 @@ class OC_Share { public function __construct($source, $uid_shared_with, $permissions) { $uid_owner = OCP\USER::getUser(); $query = OCP\DB::prepare("INSERT INTO *PREFIX*sharing VALUES(?,?,?,?,?)"); + // Check if this is a reshare and use the original source + if ($result = OC_Share::getSource($source)) { + $source = $result; + } if ($uid_shared_with == self::PUBLICLINK) { $token = sha1("$uid_shared_with-$source"); $query->execute(array($uid_owner, self::PUBLICLINK, $source, $token, $permissions));