]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use original source when resharing a file, fixes bug oc-210
authorMichael Gapczynski <GapczynskiM@gmail.com>
Mon, 14 May 2012 21:30:32 +0000 (17:30 -0400)
committerMichael Gapczynski <GapczynskiM@gmail.com>
Mon, 14 May 2012 21:31:03 +0000 (17:31 -0400)
apps/files_sharing/lib_share.php

index 02e4b6e4c26532a5e714cf6d49b84ed8af9c5ef9..73ddaf0b9ea8e2b8cf162df6c0c1bae7bb7d1205 100755 (executable)
@@ -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));