diff --git a/ext/pdo_pgsql/tests/gh12423.phpt b/ext/pdo_pgsql/tests/gh12423.phpt index 11d299af51f51..8e479d3e5da65 100644 --- a/ext/pdo_pgsql/tests/gh12423.phpt +++ b/ext/pdo_pgsql/tests/gh12423.phpt @@ -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);