Bug #62479 [Opn->Ver]: PDO-psql cannot connect if password contains spaces

From: Date: Mon, 17 Sep 2012 19:38:13 +0000
Subject: Bug #62479 [Opn->Ver]: PDO-psql cannot connect if password contains spaces
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-173507@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62479&edit=1

 ID:                 62479
 Updated by:         willfitch@php.net
 Reported by:        brice at bmaron dot net
 Summary:            PDO-psql cannot connect if password contains spaces
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            PDO related
 Operating System:   Linux- Debian Stable
 PHP Version:        5.3.14
-Assigned To:        
+Assigned To:        willfitch
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[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


Thread (16 messages)

« previous php.bugs (#173507) next »