diff --git a/checkin_notes b/checkin_notes index 8d6c8cab34..d3cffed76f 100755 --- a/checkin_notes +++ b/checkin_notes @@ -11185,6 +11185,7 @@ David 30 Aug 2005 - include pubDate in RSS feed - change getallheaders() to apache_request_headers() (the former apparently not defined in PHP5) + - if apache_request_headers() is not defined, disable caching html/ inc/ diff --git a/html/inc/cache.inc b/html/inc/cache.inc index 5befe7ef17..70c3524b39 100644 --- a/html/inc/cache.inc +++ b/html/inc/cache.inc @@ -2,6 +2,12 @@ require_once("../project/cache_parameters.inc"); +#ifdef apache_request_headers + $no_cache = false; +#else + $no_cache = true; +#endif + // mechanism for caching commonly-accessed pages function make_cache_dirs() { @@ -139,6 +145,8 @@ function get_cached_data($max_age,$params=""){ } function start_cache($max_age, $params=""){ + if ($no_cache) return; + $path = get_path($params); cache_check_diskspace(); //Check free disk space once in a while @@ -179,6 +187,8 @@ function start_cache($max_age, $params=""){ // write output buffer both to client and to cache // function end_cache($max_age,$params=""){ + if ($no_cache) return; + // for the benefit of hackers if (strstr($params, "..")) { return;