php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2546 virtual() causes HTTP headers problems
Submitted: 1999-10-16 18:18 UTC Modified: 2000-06-06 09:32 UTC
From: lane at rettig dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Beta 2 OS: RedHat Linux 6.1
Private report: No CVE-ID: None
 [1999-10-16 18:18 UTC] lane at rettig dot com
I'm running Apache 1.3.9 on RedHat 6.1 with mod_perl/1.21 and PHP/4.0B2 (as a module).  I believe I have found a bug in php4, since it does not exist in php3, is not mentioned in the incompatibilities, and cannot be explained otherwise.

When a PHP4 document is parsed and sent to the user via HTTP, IF and ONLY IF the FIRST PHP command in that file is a virtual() command, the HTTP headers for the entire user request get screwed up.  This command must also begin on the first line of the file (there cannot be a single blank line or a single character before the opening PHP tag, though the PHP tag itself may span more than one line), and there must be nothing in the PHP tag besides the virtual() command (simply adding an echo "x" command before it stops the bug from occurring).

If the FIRST output sent by the PHP document to the user (that is, not even a single newline is sent before the first virtual() command is parsed), the HTTP headers for the entire request don't get printed until after the output of this first virtual() command, so that MSIE will interpret the request as text (as it does when no http headers are present), and Netscape will interpret it as HTML but display the http headers awkwardly.

I put up a quick example script here: http://www.blizzardgames.com/~sandman/test.php.  The contents of test.php are as follows:

<?
virtual("test.txt");
?>

the contents of test.txt is just the string "this is the contents of test.txt".

Regards,
Lane Rettig

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-06 09:32 UTC] stas at cvs dot php dot net
Fixed in CVS, patch by Marc Pohl
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 20:01:30 2024 UTC