Edit report at https://bugs.php.net/bug.php?id=68296&edit=1
ID: 68296
Updated by: [email protected]
Reported by: dave at lyte dot id dot au
Summary: \n in path with parse_url() converts to underscore
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: URL related
Operating System: OS X
PHP Version: 5.4.34
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmb69
Revision: https://github.com/php/doc-en/commit/416b9e9bdb397c47bfadcf1a11669e0239942848
Log: Fix #68296: \n in path with parse_url() converts to underscore
Previous Comments:
------------------------------------------------------------------------
[2019-08-05 17:31:10] [email protected]
This is not a bug, but rather deliberate albeit undocumented
behavior, namely that all control characters in a string passed to
parse_url() are replaced by underscores[1]. Therefore I'm
changing to doc problem.
If you want to have that behavior changed, feel free to start the
RFC process[2].
[1] <https://github.com/php/php-src/blob/6326717dccf9e85dc41b3778692b790e2501fb2a/ext/standard/url.c#L59>
[2] <https://wiki.php.net/rfc/howto>
------------------------------------------------------------------------
[2018-01-11 20:25:31] gonzad26 at gmail dot com
Pardon me, bug still in PHP 7.1.7.
------------------------------------------------------------------------
[2018-01-11 19:05:15] spam2 at rhsoft dot net
besides PHP5 is EOL what do you expect?
garbage in, garbage out!
control chars don't belong into a url - it's that simple and if you don't sanitze and validate your input data be happy that someone does
what do you think happens with null chars and freinds if you concat your remote URL based on userinput and obviously don't care about handle untrusted data careful?
------------------------------------------------------------------------
[2018-01-11 19:01:02] gonzad26 at gmail dot com
The problem still persists in php 5.6.
Doing: parse_url($path,PHP_URL_HOST);
if $path has a "\n" parse_url returns and _ where the \n was.
------------------------------------------------------------------------
[2016-01-15 08:11:46] simonsimcity at gmail dot com
Sorry, I meant related to #52923
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=68296
--
Edit this bug report at https://bugs.php.net/bug.php?id=68296&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.