Bug #80277 [Com]: parse_url & parse_str problems with values with percentage

From: Date: Fri, 23 Oct 2020 19:07:49 +0000
Subject: Bug #80277 [Com]: parse_url & parse_str problems with values with percentage
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229897@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80277&edit=1

 ID:                 80277
 Comment by:         eveg at ldbdh dot com
 Reported by:        nnikolay at gmail dot com
 Summary:            parse_url & parse_str problems with values with
                     percentage
 Status:             Not a bug
 Type:               Bug
 Package:            URL related
 Operating System:   Debian 10
 PHP Version:        7.4.11
 Block user comment: N
 Private report:     N

 New Comment:

it's not the job of the docs for a programing language to educate you about absolute BASICS of
the data you work with


Previous Comments:
------------------------------------------------------------------------
[2020-10-23 18:58:45] requinix@php.net

parse_url does not parse the query string. It will return
"campaignid=%campaignid%&adid=%bannerid%".

parse_str *does* parse the query string. And the docs already say
> Note:
> All variables created (or values returned into array if second parameter is set)
> are already urldecode()d.

------------------------------------------------------------------------
[2020-10-23 18:40:29] nnikolay at gmail dot com

Super! Then add it please here: https://www.php.net/manual/en/function.parse-url.php
and save next time someone half a day to look for a solution because if this is expected, it should
be documented at the right place.

------------------------------------------------------------------------
[2020-10-23 18:35:30] girgias@php.net

% has special semantics in URL see:

>>>    In addition, octets may be encoded by a character triplet consisting
   of the character "%" followed by the two hexadecimal digits (from
   "0123456789ABCDEF") which forming the hexadecimal value of the octet.
   (The characters "abcdef" may also be used in hexadecimal encodings.)

Source: Section 2.2. URL Character Encoding Issues of RFC 1738 - Uniform Resource Locators (URL)
http://www.faqs.org/rfcs/rfc1738.html

------------------------------------------------------------------------
[2020-10-23 18:22:12] nnikolay at gmail dot com

Then do something and comment it on your docu page before trying to make the other people clueless.
If it's in the docu it is ok and makes sense, if not it is unexpected behavior and in each
language, it is a BUG. Only because you think to know it, means not, that other people need to try
all the variations of some function and to see what would be the results.

------------------------------------------------------------------------
[2020-10-23 18:03:43] eveg at dbdh dot com

what about trying to understand how the basics are working before stubborn comments full of
clueless?

the % has a special meaning - period

------------------------------------------------------------------------


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=80277


--
Edit this bug report at https://bugs.php.net/bug.php?id=80277&edit=1


Thread (13 messages)

« previous php.bugs (#229897) next »