PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Mail » Mail_IMAPv2 » Bug #8828

parse_url crashes if password contents '/' character

Details

Submitted2006-10-02 04:28 UTC
Fromtivashchenko at swsoft dot com
StatusBogus
PackageMail_IMAPv2
PHP Version4.3.10
OSLinux
Roadmaps(Not assigned)

Comments

[2006-10-02 04:28 UTC] tivashchenko at swsoft dot com

Description:
------------
If mail password contents '/' character parse_url() crushes and we can't login to mail server via Mail_IMAPv2->connect()

Solution: to use urlencode() for password in connection string (eg., 'imap://user:'.urlencode('pass/').'@localhost:143/INBOX';) and urldecode inside connect() method as for user name.

Test script:
---------------
$connection ='imap://user:pass/@localhost:143/INBOX';

$msg =& new Mail_IMAPv2();
// Open up a mail connection
if( !$msg->connect( $connection ) ){
echo $msg->alerts();
echo $msg->errors();
echo "<span style='font-weight: bold;'>Error:</span> Unable to build a connection.";
}

Expected result:
----------------
PHP warnigs about using of parse_url()

Actual result:
--------------
We should not see these warnings and normaly connect to mail server