#20919 [Opn->Bgs]: parse_url mishandles usernames with '@' signs

From: Date: Tue, 10 Dec 2002 11:13:10 +0000
Subject: #20919 [Opn->Bgs]: parse_url mishandles usernames with '@' signs
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-27247@lists.php.net to get a copy of this message
ID: 20919 Updated by: derick@php.net Reported By: danny@kyboshed.com -Status: Open +Status: Bogus Bug Type: URL related Operating System: FreeBSD 4.6 PHP Version: 4.2.3 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Not a bug, it's an URL, and you need to encode characters in there. (for example with urlencode). Derick Previous Comments: ------------------------------------------------------------------------ [2002-12-10 05:10:35] danny@kyboshed.com parse_url breaks if a username containing an '@' sign is used: <?php $url=parse_url('http://me@abc.com:pass@xyz.org/page.php'); var_dump($url); ?> Returns: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(7) "abc.com" ["user"]=> string(2) "me" ["path"]=> string(9) "/page.php" } Should return: array(5) { ["scheme"]=> string(4) "http" ["host"]=> string(7) "xyz.org" ["user"]=> string(10) "me@abc.com" ["pass"]=> string(4) "pass" ["path"]=> string(9) "/page.php" } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20919&edit=1

« previous php.bugs (#27247) next »