Skip to content

Commit 788ae50

Browse files
Fixing empty database url result bug in DotEnv::getDatabaseName method.
1 parent f1008e8 commit 788ae50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Dotenv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public function getDatabaseName(): string
254254
return $this->databaseName;
255255
}
256256
$result = parse_url($this->get('database_url'), PHP_URL_PATH);
257-
if (NULL === $result || trim($result) === '/') {
257+
if (NULL === $result || trim($result) === '/' || trim($result) === '') {
258258
// Multi-site configuration detected. Try to use the DATABASE_NAME variable.
259259
$result = $this->get('database_name');
260260
if (! $result) {

0 commit comments

Comments
 (0)