Bug #80277 [Opn->Nab]: parse_url & parse_str problems with values with percentage

From: Date: Fri, 23 Oct 2020 15:09:54 +0000
Subject: Bug #80277 [Opn->Nab]: parse_url & parse_str problems with values with percentage
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229882@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
 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


Thread (13 messages)

« previous php.bugs (#229882) next »