]> source.dussan.org Git - nextcloud-server.git/commitdiff
Update the target when it isempty after sharing 20016/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Mon, 16 Mar 2020 12:38:55 +0000 (13:38 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Wed, 18 Mar 2020 12:38:00 +0000 (12:38 +0000)
Hooks that listen to it (audit log) benefit from having the target
properly set.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
lib/private/Share20/Manager.php

index ca668e24e7f2c04db2c6e8540bba797ed7783ebc..82e948344c1004e1012d7c0dd2e0e81d0c1c09ab 100644 (file)
@@ -784,6 +784,11 @@ class Manager implements IManager {
                //reuse the node we already have
                $share->setNode($oldShare->getNode());
 
+               // Reset the target if it is null for the new share
+               if ($share->getTarget() === '') {
+                       $share->setTarget($target);
+               }
+
                // Post share event
                $event = new GenericEvent($share);
                $this->legacyDispatcher->dispatch('OCP\Share::postShare', $event);