Bug #18323 Updated: Bug in DB module
| From: | utirpan at hotmail dot com | Date: | Mon, 15 Jul 2002 03:23:08 +0000 |
| Subject: | Bug #18323 Updated: Bug in DB module | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7716@lists.php.net to get a copy of this message | ||
ID: 18323
Updated by: utirpan@hotmail.com
Reported By: utirpan@hotmail.com
Status: Bogus
Bug Type: PEAR related
Operating System: Windows NT 4
PHP Version: 4.2.1
New Comment:
The code you submitted works on Windows.
But the code below wont work(just like in DOCs):
$pass = 'abc+d';
$dsn = "mysql://$user:$pass@$host/$db_name";
$db = DB::connect($dsn, true);
As Thomas says, it is looks like a DSN issue.
This needs to be documented in PEAR.
I apologize posting this as PEAR bug, I am not
a PHP code expert.
Thanks for all prompt responses.
Previous Comments:
------------------------------------------------------------------------
[2002-07-13 12:43:10] cox@php.net
This is not a bug in PHP or DB. PEAR DB provides a way to escape chars
that can be confused with other parts of the DSN.
In this case, you should use:
$pass = urlencode($pass);
$dsn = mysql://foo:$pass@bar
In the lastest version of the parseDSN() function, perhaps there is no
more need to do that, I'll look to see if we can remove that
requirement in the future.
Tomas V.V.Cox
------------------------------------------------------------------------
[2002-07-13 09:32:17] floripa@php.net
That's not true (at least on UNIX).
See an example at:
http://www.organiKa.com.br/floripa/PEAR/urldecode.php
I think this maybe not a PEAR related issue but a problem with
urlencode()/urldecode() on Windows.
Can you please try to execute that code on your system to see if you
get the same result as on UNIX?
------------------------------------------------------------------------
[2002-07-12 23:12:48] utirpan@hotmail.com
PEAR/DB.php:line 482
$parsed['password'] = urldecode(substr $str, $pos + 1));
urldecode changes password values:
password="abc+d" -> bcomes -> password="abc d"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18323&edit=1