Opened 6 years ago
Closed 4 years ago
#4918 closed enhancement (wontfix)
Simpler resolution to ticket 3215, wp_redirect status code on fastcgi
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch needs-testing commit |
| Cc: | chmac, markjaquith, abischof |
Description
The resolution to ticket #3215 was at source:/trunk/wp-includes/pluggable.php@latest#L420
The code is:
if ( php_sapi_name() != 'cgi-fcgi' )
status_header($status); This causes problems on IIS and some FastCGI setups
header("Location: $location");
This is simpler and works on both mod_php and fast cgi:
header("Location: $location",null,$status);
Any reason why not to use this approach? I've attached a patch.
Attachments (2)
Change History (10)
Also, this approach actually sends the redirect code on fast cgi, the current code does not, it defaults to a 302 redirect.
the 2nd and 3rd parameters are only available for PHP >= 4.3.0, WP's baseline is 4.2
Heres the definition for the status_header() function:
http://trac.wordpress.org/browser/trunk/wp-includes/functions.php#L746
As you see, it checks the version and calls appropriately.
Maybe a similar code structure can be used there as well?
- Cc chmac added
Good point, I hadn't checked that. How about this latest patch instead then?
comment:4
markjaquith — 6 years ago
No way we're touching this so close to release. We can explore this for 2.4, but our experience with this stuff is that when you change anything, you break it for a whole bunch of people.
- Keywords has-patch needs-testing early added; wp_redirect removed
- Keywords commit added; early removed
we're now requiring php 4.3. commit or wontfix?

Patch