Edit report at https://bugs.php.net/bug.php?id=80277&edit=1
ID: 80277
Updated by: cmb@php.net
Reported by: nnikolay at gmail dot com
Summary: parse_url & parse_str problems with values with
percentage
-Status: Open
+Status: Not a bug
Type: Bug
-Package: *General Issues
+Package: URL related
Operating System: Debian 10
PHP Version: 7.4.11
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Percent characters in an URI introduce a percent-encoded[1]
character, and parse_url() and parse_str() interpret it as such.
A literal percent character would have to be written as %25 in an
URI, see <https://3v4l.org/2C3Bo>.
[1] <https://en.wikipedia.org/wiki/Percent-encoding>
Previous Comments:
------------------------------------------------------------------------
[2020-10-23 14:37:07] nnikolay at gmail dot com
Description:
------------
parse_url & parse_str have problems, when in the URL is some value with percent in the form:
domain.com/?campaignid=%campaignid%&adid=%bannerid%
Then both of them are converting the "%" in some unicode, which breaks the code:
array(4) {
["scheme"]=>
string(5) "https"
["host"]=>
string(19) "domain"
["path"]=>
string(16) "/path/"
["query"]=>
array(6) {
["campaignid"]=>
string(10) "�mpaignid%"
["adid"]=>
string(8) "�nnerid%"
}
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80277&edit=1