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

From: Date: Wed, 04 Jul 2012 12:29:56 +0000
Subject: Bug #62479 [Opn]: PDO-psql cannot connect if password contains spaces
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-171737@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
 User updated by:    brice at bmaron dot net
 Reported by:        brice at bmaron dot net
 Summary:            PDO-psql cannot connect if password contains spaces
 Status:             Open
 Type:               Bug
 Package:            PDO related
 Operating System:   Linux- Debian Stable
 PHP Version:        5.3.14
 Block user comment: N
 Private report:     N

 New Comment:

It seems to be a pdo-psql only ... not affecting other drivers like mysql


Previous Comments:
------------------------------------------------------------------------
[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 (#171737) next »