]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't notify admins if no potentially over exposing links found 15745/head
authorDaniel Kesselberg <mail@danielkesselberg.de>
Sun, 26 May 2019 13:50:56 +0000 (15:50 +0200)
committerBackportbot <backportbot-noreply@rullzer.com>
Mon, 27 May 2019 09:52:20 +0000 (09:52 +0000)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
lib/private/Repair/RemoveLinkShares.php

index 55b5a7c1fae0bfa05ede0f47b6c9f28273f04677..dd020dae5023aac93e81b18c76a476db61f42516 100644 (file)
@@ -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');
        }
 }