Skip to content

Commit 0c4f49d

Browse files
committed
Add back not empty check, fixes #753
1 parent 9baab58 commit 0c4f49d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Jenssegers/Mongodb/Connection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ protected function createConnection($dsn, array $config, array $options)
137137
}
138138

139139
// Check if the credentials are not already set in the options
140-
if (!isset($options['username']) && isset($config['username'])) {
140+
if (!isset($options['username']) && !empty($config['username'])) {
141141
$options['username'] = $config['username'];
142142
}
143-
if (!isset($options['password']) && isset($config['password'])) {
143+
if (!isset($options['password']) && !empty($config['password'])) {
144144
$options['password'] = $config['password'];
145145
}
146146

0 commit comments

Comments
 (0)