summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-03-16 13:38:55 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2020-03-16 13:38:55 +0100
commitb944115a3524bacc9f321df38b52e4c9ea92beac (patch)
treef3bcef2e9596c8bb27e00b7d5357470419edb278 /lib
parent48bdd322a210e5e80ad1bb80ecbe86fad5ba28d1 (diff)
downloadnextcloud-server-b944115a3524bacc9f321df38b52e4c9ea92beac.tar.gz
nextcloud-server-b944115a3524bacc9f321df38b52e4c9ea92beac.zip
Update the target when it isempty after sharing
Hooks that listen to it (audit log) benefit from having the target properly set. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Share20/Manager.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index ca668e24e7f..82e948344c1 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -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);