From: zent at piments dot com Operating system: linux PHP version: 5.2.6 PHP Bug Type: HTTP related Bug description: default headers blocks correct http responce
Description: ------------ if no call is made to header() , php inserts Content-Type: text/html this may well be incorrect, as for example in creating image/png HTTP spec allows sending content without a content-type header and allows the client to detect type from the data, in this case first four bytes are %PNG However, this content sniffing is allowed "if and only if" there are no headers explicitly present. Thus in adding a default text (or other inappropriate default) header php is preventing the client from correctly displaying the data. Reproduce code: --------------- <?php $i=imagecreate(....); imagepng($i); imagedestroy($i); ?> Expected result: ---------------- data served without content-type header and correctly interpreted by client sniffing content as defined in spec. Actual result: -------------- incorrect insertion of erroneous header forces image data to be displayed as text. -- Edit bug report at http://bugs.php.net/?id=46703&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46703&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46703&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46703&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46703&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46703&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46703&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46703&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46703&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46703&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46703&r=support Expected behavior: http://bugs.php.net/fix.php?id=46703&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46703&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46703&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46703&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46703&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46703&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46703&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46703&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46703&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46703&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46703&r=mysqlcfg