mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-31 15:59:44 +01:00
Send headers in a CGI friendly way
git-svn-id: http://svn.automattic.com/wordpress/trunk@2336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b566c4323c
commit
64e772f076
@ -109,6 +109,9 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||
// Sending HTTP headers
|
||||
|
||||
if ( !empty($error) && '404' == $error ) {
|
||||
if ( preg_match('/cgi/', php_sapi_name()) )
|
||||
@header('Status: 404 Not Found');
|
||||
else
|
||||
@header('HTTP/1.x 404 Not Found');
|
||||
} else if ( empty($feed) ) {
|
||||
@header('X-Pingback: '. get_bloginfo('pingback_url'));
|
||||
@ -134,7 +137,7 @@ if ( !empty($error) && '404' == $error ) {
|
||||
(($client_last_modified == $wp_last_modified) && ($client_etag == $wp_etag)) :
|
||||
(($client_last_modified == $wp_last_modified) || ($client_etag == $wp_etag)) ) {
|
||||
if ( preg_match('/cgi/',php_sapi_name()) ) {
|
||||
header('HTTP/1.1 304 Not Modified');
|
||||
header('Status: 304 Not Modified');
|
||||
echo "\r\n\r\n";
|
||||
exit;
|
||||
} else {
|
||||
@ -183,7 +186,10 @@ if ( (0 == count($posts)) && !is_404() && !is_search()
|
||||
&& !empty($_SERVER['QUERY_STRING']) &&
|
||||
(false === strpos($_SERVER['REQUEST_URI'], '?')) ) {
|
||||
$wp_query->is_404 = true;
|
||||
header('HTTP/1.x 404 Not Found');
|
||||
if ( preg_match('/cgi/', php_sapi_name()) )
|
||||
@header('Status: 404 Not Found');
|
||||
else
|
||||
@header('HTTP/1.x 404 Not Found');
|
||||
}
|
||||
|
||||
if ($pagenow != 'post.php' && $pagenow != 'edit.php') {
|
||||
|
Loading…
Reference in New Issue
Block a user