|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-07-13 16:46 UTC] edink@php.net
[2002-07-20 02:21 UTC] phpman at toowards dot com
[2002-08-22 01:27 UTC] phpman at toowards dot com
[2002-08-22 17:20 UTC] sniper@php.net
[2002-08-22 18:56 UTC] phpman at toowards dot com
[2002-09-21 10:46 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 18:00:01 2025 UTC |
The code (from the Header() manual page) header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // HTTP/1.0 only outputs a single "Cache-control" - the second one. It seems to me that the "replace" flag of sapi_header was never being checked. I've written a fix for this though as shown below. I hope this is right, and that it is useful to someone :-) diff -aur php-4.1.0/sapi/apache/mod_php4.c php-4.1.0-tt/sapi/apache/mod_php4.c --- php-4.1.0/sapi/apache/mod_php4.c Mon Sep 17 01:49:55 2001 +++ php-4.1.0-tt/sapi/apache/mod_php4.c Tue Jan 15 16:15:28 2002 @@ -206,8 +206,10 @@ r->content_type = pstrdup(r->pool, header_content); } else if (!strcasecmp(header_name, "Set-Cookie")) { table_add(r->headers_out, header_name, header_content); - } else { + } else if ( sapi_header->replace ) { table_set(r->headers_out, header_name, header_content); + } else { + table_add(r->headers_out, header_name, header_content); } *p = ':'; /* a well behaved header handler shouldn't change its original arguments */