Skip to content

Commit

Permalink
Fix query string encoding in core-http-reencode-not-encoded-characters
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Sep 19, 2023
1 parent 4c31516 commit f893c9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ MU Plugin Template
*/
```

See [/mu-plugins/](/mu-plugins/) directory for its content.
See [/mu-plugins/](/mu-plugins/) directory for MU plugins.

## Plugin authors with enterprise mindset

Expand Down
5 changes: 3 additions & 2 deletions mu-plugins/_core-http-reencode-not-encoded-characters.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ static function () {
// * character from Google Analytics
$query_parameters = [];
parse_str($parsed_url['query'], $query_parameters);
$query_string = http_build_query($query_parameters, '', '&', PHP_QUERY_RFC3986);
$request_uri .= '?' . $query_string;
// RFC 3986
$request_uri = add_query_arg(rawurlencode_deep($query_parameters), $request_uri);
$query_string = ltrim(add_query_arg(rawurlencode_deep($query_parameters), ''), '?');
}

$_SERVER['REQUEST_URI'] = $request_uri;
Expand Down

0 comments on commit f893c9b

Please sign in to comment.