php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19952 PEAR DB plus "+" sign in password field
Submitted: 2002-10-17 09:18 UTC Modified: 2002-10-28 23:08 UTC
From: miki_fossati at libero dot it Assigned:
Status: Not a bug Package: PEAR related
PHP Version: 4.2.3 OS: linux SUSE 7.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: miki_fossati at libero dot it
New email:
PHP Version: OS:

 

 [2002-10-17 09:18 UTC] miki_fossati at libero dot it
Here's a little test:

<?php
$failDsn = "mysql://foo:bar+@localhost/foo";
$succDsn = array(
                   "phptype"  => "mysql",
                   "hostspec" => "localhost",
                   "database" => "foo",
                   "username" => "foo",
                   "password" => "bar+"
                );
$failDb = DB::connect($failDsn, true);
$succDb = DB::connect($succDsn, true);
if (DB::isError($failDb)) {
    echo "failDsn incorrect?\n";
}
if (DB::isError($succDb)) {
    echo "Hey! are you kidding?\n";
}
?>

It seems that the plus "+" sign in the password field causes a bad parsing on the DSN string.

./configure --with-apxs=../apache/bin/apxs --with-mcrypt --with-mhash --with-xml --with-mysql=../mysql/ --enable-cli --enable-pcntl

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [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-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC