ID: 38859 Updated by: [EMAIL PROTECTED] Reported By: schappy at mail dot ru -Status: Open +Status: Assigned Bug Type: URL related Operating System: all PHP Version: 4.4.4 -Assigned To: +Assigned To: iliaa New Comment:
Ilia, please take a look at this patch: http://tony2001.phpclub.net/dev/tmp/bug38859.diff Previous Comments: ------------------------------------------------------------------------ [2006-09-17 10:54:23] schappy at mail dot ru Description: ------------ If you specify a username/password containing a '@'-sign the parse_url will not decode the password correctly. See example below. While parsing the string, it should be used the last index of '@' to find the hostname instead of the first occurence. Reproduce code: --------------- <?php $url = 'http://user:@[EMAIL PROTECTED]/path?argument?value#etc'; print_r(parse_url($url)); ?> Array ( [scheme] => http [host] => [EMAIL PROTECTED] [user] => user [path] => /path [query] => argument?value [fragment] => etc ) Expected result: ---------------- <?php $url = 'http://user:@[EMAIL PROTECTED]/path?argument?value#etc'; print_r(parse_url($url)); ?> Array ( [scheme] => http [pass] => @pass [host] => host [user] => user [path] => /path [query] => argument?value [fragment] => etc ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38859&edit=1