Reformat and simplify the check for file system access
authorAlexander Ebert <ebert@woltlab.com>
Sun, 10 Sep 2023 10:26:46 +0000 (12:26 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 10 Sep 2023 10:26:46 +0000 (12:26 +0200)
files/lib/system/exporter/WBB4xExporter.class.php

index 46b29fdb59d6f36a15d30957bca8b5ba0fb758f5..5d81bae51f50fd9cd739d3dce4e956035bab70c6 100644 (file)
@@ -254,16 +254,19 @@ final class WBB4xExporter extends AbstractExporter
     public function validateFileAccess()
     {
         foreach ($this->requiresFileAccess as $item) {
-            if (\in_array($item, $this->selectedData)) {
-                if (
-                    empty($this->fileSystemPath)
-                    || (!@\file_exists($this->fileSystemPath . 'lib/core.functions.php')
-                        && !@\file_exists($this->fileSystemPath . 'wcf/lib/core.functions.php')
-                    )
-                ) {
-                    return false;
-                }
-                break;
+            if (!\in_array($item, $this->selectedData)) {
+                continue;
+            }
+
+            if (empty($this->fileSystemPath)) {
+                return false;
+            }
+
+            if (
+                !@\file_exists($this->fileSystemPath . 'lib/core.functions.php')
+                && !@\file_exists($this->fileSystemPath . 'wcf/lib/core.functions.php')
+            ) {
+                return false;
             }
         }