From 30160420a8a764d7f5d6020ce5495366105b6a8a Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Fri, 22 Aug 2008 09:20:13 +0000 Subject: [PATCH] * Added header('Status:...') calls so that some CGI installations of apache emit proper headers (garvinhicking) --- docs/NEWS | 3 +++ exit.php | 1 + include/genpage.inc.php | 1 + include/plugin_api.inc.php | 2 +- index.php | 5 +++++ rss.php | 1 + serendipity_config.inc.php | 1 + 7 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/NEWS b/docs/NEWS index 7b8475cf..e3874e0b 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 1.4 () ------------------------------------------------------------------------ + * Added header('Status:...') calls so that some CGI installations + of apache emit proper headers (garvinhicking) + * Add a "Configure this plugin" link to the frontend output for every sidebar plugin, not only HTML nuggets. (garvinhicking) diff --git a/exit.php b/exit.php index 98c5c8e9..fa6a013c 100644 --- a/exit.php +++ b/exit.php @@ -27,6 +27,7 @@ if (isset($_GET['url_id']) && !empty($_GET['url_id']) && isset($_GET['entry_id'] if (serendipity_isResponseClean($url)) { header('HTTP/1.0 301 Moved Permanently'); + header('Status: 301 Moved Permanently'); header('Location: ' . $url); } exit; diff --git a/include/genpage.inc.php b/include/genpage.inc.php index 4f97c5a6..a877d807 100644 --- a/include/genpage.inc.php +++ b/include/genpage.inc.php @@ -54,6 +54,7 @@ if ($serendipity['smarty_raw_mode']) { $serendipity['smarty']->assign('head_subtitle', $serendipity['head_subtitle']); $serendipity['view'] = '404'; serendipity_header('HTTP/1.0 404 Not found'); + serendipity_header('Status: 404 Not found'); } serendipity_printEntries($entry, 1); diff --git a/include/plugin_api.inc.php b/include/plugin_api.inc.php index dd6b929c..f0efeb0a 100644 --- a/include/plugin_api.inc.php +++ b/include/plugin_api.inc.php @@ -849,7 +849,7 @@ class serendipity_plugin_api ob_end_clean(); if ($loggedin) { - $content .= '
' . ADMIN . ': ' . EDIT . '
'; + $content .= '
' . EDIT . '
'; } if ($show_plugin !== false) { diff --git a/index.php b/index.php index 3bdfddc6..e762c98a 100644 --- a/index.php +++ b/index.php @@ -18,6 +18,7 @@ if ($global_debug) { // We need to set this to return a 200 since we use .htaccess ErrorDocument // rules to handle archives. header('HTTP/1.0 200'); +header('Status: 200 OK'); // Session are needed to also remember an autologin user on the frontend ob_start(); @@ -306,6 +307,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range } else { $serendipity['view'] = '404'; header('HTTP/1.0 404 Not found'); + header('Status: 404 Not found'); } ob_start(); @@ -447,6 +449,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range if (!is_array($cInfo)) { $serendipity['view'] = '404'; header('HTTP/1.0 404 Not found'); + header('Status: 404 Not found'); } else { $serendipity['head_title'] = $cInfo['category_name']; $serendipity['head_subtitle'] = $serendipity['blogTitle']; @@ -492,6 +495,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range if (!is_array($uInfo)) { $serendipity['view'] = '404'; header('HTTP/1.0 404 Not found'); + header('Status: 404 Not found'); } else { $serendipity['head_title'] = sprintf(ENTRIES_BY, $uInfo[0]['realname']); $serendipity['head_subtitle'] = $serendipity['blogTitle']; @@ -604,6 +608,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range } else { $serendipity['view'] = '404'; header('HTTP/1.0 404 Not found'); + header('Status: 404 Not found'); include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); // printf('
' . DOCUMENT_NOT_FOUND . '
', $uri); } diff --git a/rss.php b/rss.php index efd3bc95..ac7ae9dc 100644 --- a/rss.php +++ b/rss.php @@ -74,6 +74,7 @@ if (!isset($_GET['nocache'])) { (!$none_match && $modified_since == $last_modified) || (!$modified_since && $none_match == $last_modified)) { header('HTTP/1.0 304 Not Modified'); + header('Status: 304 Not Modified'); return; } } diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php index 46202f76..0b138866 100644 --- a/serendipity_config.inc.php +++ b/serendipity_config.inc.php @@ -287,6 +287,7 @@ if (IS_installed === true) { if (!isset($_SERVER['PHP_AUTH_USER'])) { header("WWW-Authenticate: Basic realm=\"Feed Login\""); header("HTTP/1.0 401 Unauthorized"); + header("Status: 401 Unauthorized"); exit; } else { if (!isset($serendipity['POST']['user'])) {