]> source.dussan.org Git - nextcloud-server.git/commitdiff
Update the target when it isempty after sharing 20018/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:40:20 +0000 (12:40 +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 eec489a0e2bec1e212dc9eb89e5818c0091f37a6..bee725362ad567d6afe17ec6753b5bac9765b10b 100644 (file)
@@ -695,6 +695,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->eventDispatcher->dispatch('OCP\Share::postShare', $event);