From c42510ae85dc5be040ed4d4d3497f7cf71b0198f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 10 Sep 2023 12:26:46 +0200 Subject: [PATCH] Reformat and simplify the check for file system access --- .../system/exporter/WBB4xExporter.class.php | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/files/lib/system/exporter/WBB4xExporter.class.php b/files/lib/system/exporter/WBB4xExporter.class.php index 46b29fd..5d81bae 100644 --- a/files/lib/system/exporter/WBB4xExporter.class.php +++ b/files/lib/system/exporter/WBB4xExporter.class.php @@ -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; } } -- 2.20.1