#29886 closed defect (bug) (fixed)
WP_HTTP::make_absolute_url() treats schemeless URLs as relative
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 4.1 |
Component: | HTTP API | Keywords: | |
Focuses: | Cc: |
Description ¶
Currently if you pass WP_HTTP::make_absolute_url()
a scheme-less url, it's converted to a absolute url based on the current domain, ignoring the host of the schemeless url.
Although Schemeless URL's are invalid in HTTP Headers, since this is a helper function used elsewhere, and because many systems don't follow the specifications strictly, we should handle schemeless url's correctly.
The correct option for this function appears to be to convert it to a protocol relative url, safe for use in a HTTP request.
Commits (3)
- [29851] Correctly support Schemeless URLs in WP_HTTP::make_absolute_url() by respecting the 'host' field if present in the relative url.
Fixes #29886… by @dd32 10 years ago - [29861] Handle deficiencies in PHP's parse_url in older versions of PHP (<5.4.7) in WP_HTTP::make_absolute_url().… by @dd32 10 years ago
- [29864] Add some unit tests for WP_HTTP::parse_url() to cover the <PHP 5.4.7 compatibility alterations.… by @dd32 10 years ago
Pull Requests
- Loading…
Change History (5)
#1
@ Lead Developer
10 years ago
- Owner set to dd32
- Resolution set to fixed
- Status changed from new to closed
#3
@ Core Committer
10 years ago
This test is failing in php 5.2
https://travis-ci.org/aaronjorbin/develop.wordpress/jobs/37362400
Note: See
TracTickets for help on using
tickets.
In 29851: