Skip to content

Commit 73e4594

Browse files
authored
Merge pull request #15745 from nextcloud/backport/15738/stable16
[stable16] Don't notify admins if no potentially over exposing links found
2 parents 1583b2a + 90ca099 commit 73e4594

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/private/Repair/RemoveLinkShares.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ private function sendNotification(): void {
201201
}
202202
}
203203

204-
private function repair(IOutput $output): void {
205-
$total = $this->getTotal();
204+
private function repair(IOutput $output, int $total): void {
206205
$output->startProgress($total);
207206

208207
$shareCursor = $this->getShares();
@@ -225,12 +224,13 @@ private function repair(IOutput $output): void {
225224
}
226225

227226
public function run(IOutput $output): void {
228-
if ($this->shouldRun()) {
229-
$output->info('Removing potentially over exposing link shares');
230-
$this->repair($output);
231-
$output->info('Removed potentially over exposing link shares');
232-
} else {
227+
if ($this->shouldRun() === false || ($total = $this->getTotal()) === 0) {
233228
$output->info('No need to remove link shares.');
229+
return;
234230
}
231+
232+
$output->info('Removing potentially over exposing link shares');
233+
$this->repair($output, $total);
234+
$output->info('Removed potentially over exposing link shares');
235235
}
236236
}

0 commit comments

Comments
 (0)