diff options
author | Michael Gapczynski <GapczynskiM@gmail.com> | 2012-05-14 17:30:32 -0400 |
---|---|---|
committer | Michael Gapczynski <GapczynskiM@gmail.com> | 2012-05-14 17:31:03 -0400 |
commit | d4271ed9dfef9a31f34bf91b8d854cbc5be0c67d (patch) | |
tree | d176b79d06acb01f11302744c0cfaf099c0ddbb5 | |
parent | 954d4e520051efedad12b8801ed314d5fb3cd13a (diff) | |
download | nextcloud-server-d4271ed9dfef9a31f34bf91b8d854cbc5be0c67d.tar.gz nextcloud-server-d4271ed9dfef9a31f34bf91b8d854cbc5be0c67d.zip |
Use original source when resharing a file, fixes bug oc-210
-rwxr-xr-x | apps/files_sharing/lib_share.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php index 02e4b6e4c26..73ddaf0b9ea 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)); |