Skip to content

Commit 6c9fbd6

Browse files
committed
🐛 proper exception handling on invalid dir
⬆️ upgraded dependencies Signed-off-by: Bruno Meilick <[email protected]>
1 parent 0e8c3e8 commit 6c9fbd6

File tree

10 files changed

+349
-192
lines changed

10 files changed

+349
-192
lines changed

classes/DotEnv.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ function ($dotenv) {
5555

5656
private function loadFromDir(string $dir, string $file): bool
5757
{
58+
$dir = realpath($dir);
5859
if (! $dir || ! $file) {
5960
return false;
6061
}
61-
$this->dotenv = \Dotenv\Dotenv::createMutable(realpath($dir), $file);
6262

6363
try {
64+
$this->dotenv = \Dotenv\Dotenv::createMutable($dir, $file);
6465
$this->dotenv->load();
6566
} catch (InvalidPathException $exc) {
6667
$this->dotenv = null;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bnomei/kirby3-dotenv",
33
"type": "kirby-plugin",
4-
"version": "2.0.2",
4+
"version": "2.0.3",
55
"description": "Kirby 3 Plugin for environment variables from .env",
66
"license": "MIT",
77
"authors": [

0 commit comments

Comments
 (0)