From 567fe4b8338a376023afc18e1806af6129147dce Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Mon, 3 Jun 2019 21:41:32 +0200 Subject: [PATCH] Don't notify admins if no potentially over exposing links found Signed-off-by: Daniel Kesselberg --- lib/private/Repair/RemoveLinkShares.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/private/Repair/RemoveLinkShares.php b/lib/private/Repair/RemoveLinkShares.php index 49850298d40..20998df6443 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) { - $total = $this->getTotal(); + private function repair(IOutput $output, int $total) { $output->startProgress($total); $shareCursor = $this->getShares(); @@ -225,12 +224,13 @@ class RemoveLinkShares implements IRepairStep { } public function run(IOutput $output) { - 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'); } } -- 2.39.5