WordPress / WordPress/Requests
IRI code urlencodes get parameters
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 500
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 5
Description
By default the url for get requests get pushed through the IRI parser/seraliser/normaliser. That class passes the query parameters through the replace_invalid_with_pct_encoding function which replaces [ and ] with %5B and %5D.
This makes PHP not recognize it as an array anymore and breaks my API calls.
For example the original url:
http://example.com/?test[a]=1&test[b]=2
Becomes the following in PHP:
$_GET['test']['a'] = 1;
$_GET['test']['b'] = 2;
but with the IRI rewrite it becomes:
$_GET['test%5Ba%5D'] = 1;
$_GET['test%5Bb%5D'] = 2;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing GET request URLs through the IRI parser, serializer, and normalizer, especially replace_invalid_with_pct_encoding. Reproduce the example with bracketed query parameters and inspect the existing URL or IRI tests. Done means the request preserves the PHP-style array parameters while retaining correct handling of other invalid query characters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100