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>
This commit is contained in:
Roeland Jago Douma 2020-03-16 13:38:55 +01:00
parent 48bdd322a2
commit b944115a35
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 5 additions and 0 deletions

View 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);