php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19481 DB doesn't allow for '@' within password (p@ssword)
Submitted: 2002-09-18 15:04 UTC Modified: 2002-10-28 23:08 UTC
From: rob at euglug dot org Assigned:
Status: Not a bug Package: PEAR related
PHP Version: 4.2.3 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
1 + 25 = ?
Subscribe to this entry?

 
 [2002-09-18 15:04 UTC] rob at euglug dot org
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 can send a patch, but what is the preferred way of handling something like this?  Asking the user to put the pass in quotes?  Or somehow determining what is the separator token and what is the password?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-02 04:37 UTC] mj@php.net
Please provide us your patch and we'll see.
 [2002-10-02 19:02 UTC] alan at akbkhome dot com
you can rawurlencode the @ sign %40
username = xxx
password = yy@yy

dns = mysql://xxx:yy%40yy@localhost/mydb

If the dsn is to follow 'http url standards' (eg. the rfc), then there is no need to change the code.. (just need to document it somewhere)
 [2002-10-28 23:08 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

If your password contains non-alphanumeric characters do a urlencode() on the value before passing it if you are using the "mysql://foo:bar+@localhost/foo" format to pass data to DB::connect();
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC