Edit report at https://bugs.php.net/bug.php?id=62479&edit=1
ID: 62479 Updated by: il...@php.net Reported by: brice at bmaron dot net Summary: PDO-psql cannot connect if password contains spaces Status: Verified Type: Bug Package: PDO related Operating System: Linux- Debian Stable PHP Version: 5.3.14 Assigned To: willfitch Block user comment: N Private report: N New Comment: I think the attached patch maybe slightly better than the one proposed, the attached patch also accounts for passwords that may contain \ character inside them. Previous Comments: ------------------------------------------------------------------------ [2012-10-31 01:51:40] il...@php.net The following patch has been added/updated: Patch Name: PDOPostgreSQLPassword Revision: 1351648300 URL: https://bugs.php.net/patch-display.php?bug=62479&patch=PDOPostgreSQLPassword&revision=1351648300 ------------------------------------------------------------------------ [2012-09-20 20:12:00] willfi...@php.net Pull request for this bug has been submitted at: https://github.com/php/php- src/pull/199. ------------------------------------------------------------------------ [2012-09-17 19:39:08] willfi...@php.net I have confirmed your findings. Let me do a little sniffing around and see what I can come up with. ------------------------------------------------------------------------ [2012-07-04 12:29:56] brice at bmaron dot net It seems to be a pdo-psql only ... not affecting other drivers like mysql ------------------------------------------------------------------------ [2012-07-04 08:56:06] brice at bmaron dot net Description: ------------ When you try to connect to a Postgresql database with a password containing 1 or more spaces, pdo will fail to connect. You must escape yourself the user & password and put it into the dsn to make it work. It may also be true for other databases ... it's not tested Test script: --------------- https://gist.github.com/3046155 Expected result: ---------------- See a connection and no error for both tries Actual result: -------------- See an error for the first one and a correct result for the second one ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62479&edit=1