ID: 49055 Updated by: [email protected] Reported By: me at anton dot in dot ua -Status: Open +Status: Bogus Bug Type: URL related Operating System: * PHP Version: 5.2.10 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 Someone might expect them to be there. Doing trim() is quite easy if you don't want them to be replaced. Previous Comments: ------------------------------------------------------------------------ [2009-07-25 09:58:14] me at anton dot in dot ua Description: ------------ parse_url convert \r\n symbols to _ _. More: OK: $string = "ftp://login:p...@domain"; array 'scheme' => string 'ftp' (length=3) 'host' => string 'domain' (length=6) 'user' => string 'login' (length=5) 'pass' => string 'pass' (length=4) BUG: $string ="ftp://login:p...@domain\r\n"; array 'scheme' => string 'ftp' (length=3) 'host' => string 'domain__' (length=8) /* wtf? */ 'user' => string 'login' (length=5) 'pass' => string 'pass' (length=4) ------------ if i get strings from file i should use trim before use parse_url. i think it is bug and parse_url should use trim - OR - ignore \r\n at the end of line. Reproduce code: --------------- $string = "ftp://login:p...@domain"; var_dump(parse_url($string)); $string = "ftp://login:p...@domain\r\n"; var_dump(parse_url($string)); Expected result: ---------------- array 'scheme' => string 'ftp' (length=3) 'host' => string 'domain' (length=6) 'user' => string 'login' (length=5) 'pass' => string 'pass' (length=4) Actual result: -------------- array 'scheme' => string 'ftp' (length=3) 'host' => string 'domain__' (length=8) /* wtf? */ 'user' => string 'login' (length=5) 'pass' => string 'pass' (length=4) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49055&edit=1
