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
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 16:01:26 2024 UTC