WordPress / WordPress/Requests

URL reformatting issue with Requests_IRI

Open
#61 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Core Status: triage
Dominant language
PHP
Stars
3.6k
Forks
500
Avg merge
2d 21h
Merged PRs (30d)
5

Description

When requesting an URL with a fragment, the reformatted URL can be different from the original one. The following example rewrites https://example.com/#foobar to https://example.com#foobar instead of returning the same URL.
As a consequence, curl fails to load the URL.

$url = "https://example.com/#foobar";
$iri = new Requests_IRI($url);
$url = $iri->uri;
var_dump($url);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Requests_IRI constructor and its URL reformatting path, using the provided fragment example as the reproducer. Verify that https://example.com/#foobar remains unchanged and that curl can load the resulting URL; add or update a regression test if the repository's existing test location is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.