1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fixed regular expression to get password from dsn (#12448)

This commit is contained in:
Saki Takamachi
2023-10-16 20:49:33 +09:00
committed by GitHub
parent 4bb75058a3
commit 47c6b3bd45

View File

@@ -19,7 +19,7 @@ if (!$user) {
$user = $match[1] ?? '';
}
if (!$password) {
preg_match('/password=(.*?) /', $dsnWithCredentials, $match);
preg_match('/password=(.*?)$/', $dsnWithCredentials, $match);
$password = $match[1] ?? '';
}
$dsn = str_replace(" user={$user} password={$password}", '', $dsnWithCredentials);