Skip to content

Commit

Permalink
Send headers in a CGI friendly way
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.automattic.com/wordpress/trunk@2336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
saxmatt committed Feb 14, 2005
1 parent b566c43 commit 64e772f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions wp-blog-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@
// Sending HTTP headers

if ( !empty($error) && '404' == $error ) {
@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');
} else if ( empty($feed) ) {
@header('X-Pingback: '. get_bloginfo('pingback_url'));
@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
Expand All @@ -134,7 +137,7 @@
(($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 {
Expand Down Expand Up @@ -183,7 +186,10 @@
&& !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') {
Expand Down

0 comments on commit 64e772f

Please sign in to comment.