#11305 closed defect (bug) (fixed)
WP_Http won't follow redirects if open_basedir is in effect
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | low | Milestone: | 3.0 |
| Component: | HTTP | Version: | 2.8.5 |
| Severity: | minor | Keywords: | reporter-feedback |
| Cc: | calin |
Description
None of the existing transport methods (tested with all methods) follow the location header if PHP setting open_basedir is in effect. This further affects the SimplePie RSS, triggering errors for redirected feeds with the error: A feed could not be found at http://thebl.og/feed/ in /wp-includes/class-simplepie.php on line 1680.
Attachments (2)
Change History (18)
- Milestone changed from Unassigned to Future Release
- Priority changed from normal to low
- Severity changed from normal to minor
- Version set to 2.8.5
- Keywords has-patch needs-testing added
- Milestone changed from Future Release to 3.0
This doesnt affect all transports.
Specifically, This affects Curl only, When Running under safe mode, or when open_basedir is set - http://core.trac.wordpress.org/browser/trunk/wp-includes/http.php#L1329 redirection is specifically disabled in the event of either.
I dont think the proposed location in the patch is the best place for it. Patch forthcoming which moves this check into the Curl handler and only activates if Follow location was disabled.
This doesnt affect all transports.
Although i've said that, I realise that the OP has stated that it does..
I've tested all the transports aside from the PHP HTTP Extension, and they all seem to play ball with the attached patch.. Taking into account #11557 & the fact that the Fsockopen transport also manually follows redirects.. The original statement didnt seem correct to me.
Updated patch based on Fsockopen's syntax, to keep the logic constant throughout the file.
Closed #10417 as Duplicate of this.
According to Sivel on that ticket:
When safe_mode or open_basedir are set it seems that the only transport that can "follow" the redirects is fsockopen. All others stop after the initial request.
So it could potentially just be my system that Streams and Fopen are following the redirects.. Can someone else confirm that?
your redirect test-script would be really helpfull for this ticket as well :)
your redirect test-script would be really helpfull for this ticket as well :)
comment:10
dd32 — 3 years ago
comment:11
dd32 — 3 years ago
- Keywords reporter-feedback added; has-patch needs-testing removed
I commited the changes that affect curl.
Could someone please report under what specific conditions streams/fopen are affected?
PHP Version, and possibly a print of phpinfo() could be very useful.
comment:12
dd32 — 3 years ago
comment:13
dd32 — 3 years ago
- Resolution set to fixed
- Status changed from new to closed
Closing as fixed due to lack of feedback. If other transports are affected, please open a new ticket with full system information and reference this ticket.
comment:14
hakre — 2 years ago
Related: #16889
comment:15
hakre — 2 years ago
Related: #16890
comment:16
cogmios — 2 years ago
see my comment on this in #16855 when redirect = 0

Isn't open_basedir supposed to go away with php6?