From: [email protected] Operating system: PHP version: 5.3.1 PHP Bug Type: Apache2 related Bug description: All Apache SAPI sets content length wrong
Description:
------------
The following SAPI that handle Apache are doing the content length setting
wrong:
apache, apache2handler, apache2filter
The problems when you do:
header("Content-Length: 20");
the SAPI module would just set the header doing a table set on
r->headers_out, but not update r->clength. Instead of doing a table set it
should be calling ap_set_content_length, which sets clength and does the
table set for you.
I found this in Apache 2.x because we have a filter that appends data to
the end of the content. It uses r->clength and updates with the
additionally data value, but it doesn't work correctly if you use the above
header PHP call.
The following patch fixes the problem:
http://www.brianfrance.com/software/php/sapi_content_length.txt
Let me know if you have any questions.
--
Edit bug report at http://bugs.php.net/?id=50940&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50940&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50940&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50940&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50940&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50940&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50940&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50940&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50940&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50940&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50940&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50940&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50940&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50940&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50940&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50940&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50940&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50940&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50940&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50940&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50940&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50940&r=mysqlcfg
