Skip to content

Commit

Permalink
Extension: Driver should be autodetected by regex.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek authored Jul 14, 2021
1 parent bbb9dd9 commit b2387ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DatabaseExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ private function loadConnectionConfiguration(): void
. 'Connection string (key "DB_URI") is not valid string.',
);
}
if (str_contains($connectionString, '//') === false) { // fix missing driver
if (!preg_match('~^[a-z]+://~', $connectionString)) { // fix missing driver
$connectionString = 'mysql://' . $connectionString;
}
$config['connection']['url'] = $connectionString;
Expand Down

0 comments on commit b2387ba

Please sign in to comment.