diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2020-03-02 09:18:04 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-03-02 09:18:04 +0100 |
commit | 7613681627a78d5994f2b21075f968a4fd50ea95 (patch) | |
tree | f836d54932bfcf3b10339129f55e87d9ade84367 /apps | |
parent | fb9a6b813457123f7b3ac8bf4574860d5e06951d (diff) | |
download | nextcloud-server-7613681627a78d5994f2b21075f968a4fd50ea95.tar.gz nextcloud-server-7613681627a78d5994f2b21075f968a4fd50ea95.zip |
Don't try to format deleted shares
Fixes #15455
The issue is that we have a fallback for shares to use the target. So
when the target exists again we happily format it (not that the shares
are still invalid).
This just tries to get the node. If we can't then boom.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 4893be25b20..68729db6de8 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -768,6 +768,16 @@ class ShareAPIController extends OCSController { $known = $formatted = $miniFormatted = []; $resharingRight = false; foreach ($shares as $share) { + try { + $share->getNode(); + } catch (NotFoundException $e) { + /* + * Ignore shares where we can't get the node + * For example delted shares + */ + continue; + } + if (in_array($share->getId(), $known) || $share->getSharedWith() === $this->currentUser) { continue; } |