Make WordPress Core

Opened 10 years ago

Last modified 9 years ago

#28001 closed defect (bug)

WP_Http still fails on some requests with relative urls — at Initial Version

Reported by: drlightman's profile DrLightman Owned by:
Milestone: 4.1 Priority: normal
Severity: normal Version: 3.9
Component: HTTP API Keywords:
Focuses: Cc:

Description

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 (0)

Note: See TracTickets for help on using tickets.