mirror of
https://github.com/php/php-src.git
synced 2026-04-09 09:03:04 +02:00
* allow empty passwords in dsn (for example "mysql://user:@database")
This commit is contained in:
@@ -413,7 +413,7 @@ class DB
|
||||
$dsn = $arr[1];
|
||||
}
|
||||
|
||||
if (preg_match("|^([^:]+):([^@]+)@?(.*)$|", $dsn, $arr)) {
|
||||
if (preg_match("|^([^:]+):([^@]*)@?(.*)$|", $dsn, $arr)) {
|
||||
$parsed["username"] = urldecode($arr[1]);
|
||||
$parsed["password"] = urldecode($arr[2]);
|
||||
$dsn = $arr[3];
|
||||
|
||||
Reference in New Issue
Block a user