1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 04:38:27 +01:00

Merge pull request #4845 from Deltik/fix/4844

Fixes #4844: File Inspector: Do not traverse above the base directory
This commit is contained in:
Cameron 2022-08-09 16:02:22 -07:00 committed by GitHub
commit 29331ea635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -601,7 +601,11 @@ class file_inspector {
$absoluteBase = realpath($baseDir);
if (!is_dir($absoluteBase)) return;
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($baseDir));
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$baseDir, FilesystemIterator::SKIP_DOTS
)
);
foreach ($iterator as $file)
{
$this->sendProgress(1);