aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2019-05-26 15:50:56 +0200
committerBackportbot <backportbot-noreply@rullzer.com>2019-05-27 09:52:20 +0000
commit90ca09934199f577a1c07472f2f783bb7bd0f8fe (patch)
tree22f3d112344d4c41cd3a31a19460f8f095ad6719 /lib
parent1583b2af91125bcb5b591494587798412a056c29 (diff)
downloadnextcloud-server-90ca09934199f577a1c07472f2f783bb7bd0f8fe.tar.gz
nextcloud-server-90ca09934199f577a1c07472f2f783bb7bd0f8fe.zip
Don't notify admins if no potentially over exposing links found
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Repair/RemoveLinkShares.php14
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');
}
}