]> granicus.if.org Git - php/commitdiff
- Fix bug #50940
authorPierre Joye <pajoye@php.net>
Fri, 5 Feb 2010 19:34:47 +0000 (19:34 +0000)
committerPierre Joye <pajoye@php.net>
Fri, 5 Feb 2010 19:34:47 +0000 (19:34 +0000)
NEWS
sapi/apache/mod_php5.c
sapi/apache2filter/sapi_apache2.c
sapi/apache2handler/sapi_apache2.c

diff --git a/NEWS b/NEWS
index f83469d00fc8deb1989ff2a521bd574ed7366b26..90d3daa456cda34dce7a9a47ab80e038a5e7e8cb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ PHP                                                                        NEWS
   links or invalid paths. (Pierre)
 - Fixed error output to stderr on Windows. (Pierre)
 
+- Fixed bug #50940 Custom content-length set incorrectly in Apache sapis. 
+  (Brian France, Rasmus)
 - Fixed bug #50907 (X-PHP-Originating-Script adding two new lines in *NIX).
   (Ilia)
 - Fixed bug #50859 (build fails with openssl 1.0 due to md2 deprecation).   
index c980597841cdb71bec550bea83244d3de3907aad..9711e3fa708a896d53c23a9a82b5f238d940dffc 100644 (file)
@@ -196,6 +196,8 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head
 
                        if (!strcasecmp(header_name, "Content-Type")) {
                                r->content_type = pstrdup(r->pool, header_content);
+                       } else if (!strcasecmp(header_name, "Content-Length")) {
+                               ap_set_content_length(r, strtol(header_content, (char **)NULL, 10));
                        } else if (!strcasecmp(header_name, "Set-Cookie")) {
                                table_add(r->headers_out, header_name, header_content);
                        } else if (op == SAPI_HEADER_REPLACE) {
index 219ae15caf90579f9e6f11d4612c9c4ae8044021..c9719b5ed7df42781690b8393b0468a32328aa5c 100644 (file)
@@ -127,6 +127,8 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_e
 
                        if (!strcasecmp(sapi_header->header, "content-type"))
                                ctx->r->content_type = apr_pstrdup(ctx->r->pool, val);
+                       else if (!strcasecmp(sapi_header->header, "content-length"))
+                               ap_set_content_length(ctx->r, strtol(val, (char **)NULL, 10));
                        else if (op == SAPI_HEADER_REPLACE)
                                apr_table_set(ctx->r->headers_out, sapi_header->header, val);
                        else
index ff63c72ceff1989a177d93e20df6cdcba1c9290e..386bef0dbc3f9f9283d4f7cf7108611d5adeed94 100644 (file)
@@ -119,6 +119,8 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_e
                                        efree(ctx->content_type);
                                }
                                ctx->content_type = estrdup(val);
+                       } else if (!strcasecmp(sapi_header->header, "content-length")) {
+                               ap_set_content_length(ctx->r, strtol(val, (char **)NULL, 10));
                        } else if (op == SAPI_HEADER_REPLACE) {
                                apr_table_set(ctx->r->headers_out, sapi_header->header, val);
                        } else {