Opened 12 years ago
Closed 12 years ago
#28001 closed defect (bug) (fixed)
WP_Http still fails on some requests with relative url redirects
| Reported by: | DrLightman | Owned by: | dd32 |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.1 |
| Component: | HTTP API | Version: | 3.9 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description (last modified by )
This is a follow-up to #20434.
WP_Http still fails (A valid URL was not provided.) with some urls with relative url redirects.
I was scraping web.archive.org with a plugin.
The combination of the relative redirects plus this kind of url:
http://web.archive.org/web/20131001160642/http://www.spiegel.de/thema/deutschland_nach_der_bundestagswahl/
is the culprit.
I think the problem is the check on the scheme in ::make_absolute_url where it does:
// Check for a scheme if ( false !== strpos( $maybe_relative_path, '://' ) ) return $maybe_relative_path;
so that a relative url like /web/20131001160642/http://www.spiegel.de/thema/deutschland_nach_der_bundestagswahl/ it's evaluated as absolute.
Change History (11)
#1
@
12 years ago
- Summary WP_Http still fails on some requests with relative urls → WP_Http still fails on some requests with relative url redirects
#5
@
12 years ago
- Resolution fixed
- Status closed → reopened
The test doesn't pass in php 5.2
https://travis-ci.org/aaronjorbin/develop.wordpress/jobs/37362400
#8
@
12 years ago
- Resolution fixed
- Status closed → reopened
This method should also be used in the helpers in wp-includes/http.php such as wp_http_validate_url(). This probably makes the function better exposed as wp_parse_url() to work around all the different PHP parse_url oddities.
#9
@
12 years ago
- Keywords dev-feedback added
@dd32: From your comment:8 seems like there are some leftover cases you wanted to handle here. Were you wanting to still do that in 4.1 or punt for anything left?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 29850: