Skip to content

Commit

Permalink
Secured access to path outside directory
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgfeller committed Dec 19, 2024
1 parent 28ef496 commit 2ec258a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
$settings = require __DIR__ . '/defaults.php';

// Load secret configuration
if (file_exists(__DIR__ . '/../../env.php')) {
require __DIR__ . '/../../env.php'; // Take env outside project dir if existing
if (file_exists(dirname(__DIR__, 2) . '/env.php')) {
require dirname(__DIR__, 2) . '/env.php'; // Take env outside project dir if existing
} elseif (file_exists(__DIR__ . '/env/env.php')) {
require __DIR__ . '/env/env.php';
}
Expand Down

0 comments on commit 2ec258a

Please sign in to comment.