[wp-trac] [WordPress Trac] #28001: WP_Http still fails on some requests with relative url redirects
WordPress Trac
noreply at wordpress.org
Wed Apr 23 22:39:47 UTC 2014
#28001: WP_Http still fails on some requests with relative url redirects
--------------------------+------------------------------
Reporter: DrLightman | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTTP API | Version: 3.9
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Description changed by SergeyBiryukov:
Old 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.
New 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.
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28001#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list