From 180ac79934441e5bf59bd3b01ee0ac3607549cbc Mon Sep 17 00:00:00 2001 From: messju Date: Sun, 10 Aug 2003 21:27:51 +0000 Subject: [PATCH] fixed status-header for cache_modified_check under cgi-sapi --- NEWS | 1 + libs/Smarty.class.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 73ba8a62..fb206083 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - fixed status-header for cache_modified_check under cgi-sapi (messju) - added optional parameter $cache_attrs to register_function() and register_block(). $cache_attrs is an array containing attribute- names that should be cached on calls to functions that have diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 229969ec..53db8d92 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1271,7 +1271,11 @@ class Smarty if (@count($this->_cache_info['insert_tags']) == 0 && !$this->_cache_serials && $_gmt_mtime == $_last_modified_date) { - header("HTTP/1.1 304 Not Modified"); + if (php_sapi_name()=='cgi') + header("Status: 304 Not Modified"); + else + header("HTTP/1.1 304 Not Modified"); + } else { header("Last-Modified: ".$_gmt_mtime); echo $_smarty_results;