diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-05-27 11:50:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-27 11:50:43 +0200 |
commit | 8b6d8ed4231e0bedf25ee5d088b128e746584d08 (patch) | |
tree | 7cce0431a587e1056908af9911eac9b26dcb7c82 /lib | |
parent | cdfd2d8dd11780b42472263ffc54ff35e7d404cc (diff) | |
parent | d00566b7501fac15e01ace70e148d1deebcc6f0c (diff) | |
download | nextcloud-server-8b6d8ed4231e0bedf25ee5d088b128e746584d08.tar.gz nextcloud-server-8b6d8ed4231e0bedf25ee5d088b128e746584d08.zip |
Merge pull request #15738 from nextcloud/enh/dont-notify-admin-if-no-exposing-share-links-found
Don't notify admins if no potentially over exposing links found
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Repair/RemoveLinkShares.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/private/Repair/RemoveLinkShares.php b/lib/private/Repair/RemoveLinkShares.php index 55b5a7c1fae..dd020dae502 100644 --- a/lib/private/Repair/RemoveLinkShares.php +++ b/lib/private/Repair/RemoveLinkShares.php @@ -201,8 +201,7 @@ class RemoveLinkShares implements IRepairStep { } } - private function repair(IOutput $output): void { - $total = $this->getTotal(); + private function repair(IOutput $output, int $total): void { $output->startProgress($total); $shareCursor = $this->getShares(); @@ -225,12 +224,13 @@ class RemoveLinkShares implements IRepairStep { } public function run(IOutput $output): void { - if ($this->shouldRun()) { - $output->info('Removing potentially over exposing link shares'); - $this->repair($output); - $output->info('Removed potentially over exposing link shares'); - } else { + if ($this->shouldRun() === false || ($total = $this->getTotal()) === 0) { $output->info('No need to remove link shares.'); + return; } + + $output->info('Removing potentially over exposing link shares'); + $this->repair($output, $total); + $output->info('Removed potentially over exposing link shares'); } } |