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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rob at euglug dot org
New email:
PHP Version: OS:

 

 [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: Sat Apr 27 04:01:30 2024 UTC