#38859 [Asn->Csd]: parse_url fails if passing '@' in passwd

From: Date: Thu, 28 Sep 2006 15:16:56 +0000
Subject: #38859 [Asn->Csd]: parse_url fails if passing '@' in passwd
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-102860@lists.php.net to get a copy of this message
ID: 38859 Updated by: iliaa@php.net Reported By: schappy at mail dot ru -Status: Assigned +Status: Closed Bug Type: URL related Operating System: all PHP Version: 4.4.4 Assigned To: iliaa New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2006-09-17 11:20:29] tony2001@php.net Ilia, please take a look at this patch: http://tony2001.phpclub.net/dev/tmp/bug38859.diff ------------------------------------------------------------------------ [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:@pass@host/path?argument?value#etc'; print_r(parse_url($url)); ?> Array ( [scheme] => http [host] => pass@host [user] => user [path] => /path [query] => argument?value [fragment] => etc ) Expected result: ---------------- <?php $url = 'http://user:@pass@host/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

« previous php.bugs (#102860) next »