]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't notify admins if no potentially over exposing links found 15861/head
authorDaniel Kesselberg <mail@danielkesselberg.de>
Mon, 3 Jun 2019 19:41:32 +0000 (21:41 +0200)
committerDaniel Kesselberg <mail@danielkesselberg.de>
Mon, 3 Jun 2019 19:41:32 +0000 (21:41 +0200)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
lib/private/Repair/RemoveLinkShares.php

index 49850298d4057c68102a50d80cc20390e642aaa8..20998df644347b7160b9c22a2dd8701da937d1af 100644 (file)
@@ -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');
        }
 }