Re: #19481 [NEW]: DB doesn't allow for '@' within password (p@ssword)

From: Date: Fri, 20 Sep 2002 00:53:08 +0000
Subject: Re: #19481 [NEW]: DB doesn't allow for '@' within password (p@ssword)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-9240@lists.php.net to get a copy of this message
Ondrej Jombik wrote:
If you have an '@' in your password, DB.php parses that as the token that separates the user:pass@host of the DSN. It should preferrably allow passwords with '@'.
       
I guess the easiest solution would be to take the last @ in the DSN as the separator between password and host. But then I'm not sure if there's a smart way to implement this without dropping the usage of parse_url().
     
shouldnt you use urlencoded @ eg. %40 - rfc1738 indicates it's a reserved character - in which case does parse_url handle it OK?
I have '@' in my password(s) not urlencoded %40 and it works well for me. I'm using these CVS versions of DB.php and DB/mysql.php: what I was getting at was that if your password is my@password, then you would put
mysql://myname:my%40password@localhost if this works (as it is supposed to acording to the rfc), then a note needs to be made in the manual that when using 'reserved characters' in passwords, you need to use the urlencoded value in the dsn. regards Alan
$ grep -h '$Id:' _lib/PEAR/DB.php _lib/PEAR/DB/mysql.php // $Id: DB.php,v 1.87 2002/03/18 17:39:28 ssb Exp $ // $Id: mysql.php,v 1.89 2002/02/28 08:27:10 sebastian Exp $ =Nepto= ____________________________________________________________________________ Ondrej 'Nepto' Jombik, Open Source software developer, http://www.platon.sk/


« previous php.pear.dev (#9240) next »