From:             clewis at myfonts dot com
Operating system: Windows XP, CentOS 4
PHP version:      5.0.5
PHP Bug Type:     Output Control
Bug description:  system() forces Content-type header output

Description:
------------
Calling the system() function forces the standard Content-type: text/html
header output, even when output buffering is on.  This behaviour is unlike
other output commands such as print, which suppress the "automatic" headers
until the output buffer is flushed.

Note that replacing system() with print() in the sample code works as
expected.

Reproduce code:
---------------
<?php

ob_start();

chdir("/");
system("ls");

ob_end_clean();

header("Content-type: text/plain");
print "Hello  World.";

?>

Expected result:
----------------
Content-type: text/plain

Hello World.


Actual result:
--------------
Content-type: text/html

Warning: Cannot modify header information - headers already sent...
Hello World.


-- 
Edit bug report at http://bugs.php.net/?id=34744&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34744&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34744&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34744&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34744&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34744&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34744&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34744&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34744&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34744&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34744&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34744&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34744&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34744&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34744&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34744&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34744&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34744&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34744&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34744&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34744&r=mysqlcfg

Reply via email to