Home » Mail » Mail_IMAPv2 » Bug #8828
parse_url crashes if password contents '/' character
Details
| Submitted | 2006-10-02 04:28 UTC |
|---|---|
| From | tivashchenko at swsoft dot com |
| Status | Bogus |
| Package | Mail_IMAPv2 |
| PHP Version | 4.3.10 |
| OS | Linux |
| 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