Bug #11439: Comments shown when lines separated by CR|CR|LF
| From: | danielc at analysisandsolutions dot com | Date: | Tue, 12 Jun 2001 16:30:08 +0000 |
| Subject: | Bug #11439: Comments shown when lines separated by CR|CR|LF | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-56886@lists.php.net to get a copy of this message | ||
From: danielc@analysisandsolutions.com
Operating system: NT 4.0 SP6a
PHP version: 4.0.5
PHP Bug Type: Scripting Engine problem
Bug description: Comments shown when lines separated by CR|CR|LF
**** ISSUE:
Comments are visible in the parsed output.
But, this is only happening when the script has it's lines separated by two carriage returns
then a line feed (CR|CR|LF) (ASCII Ordinals: 13|13|10). If the file has lines broken by one
carriage return then a line feed, things run correctly.
This report may shed light on bug #11303, entitled "Comment Characters," submitted by
another user on 5 June 2001: http://www.php.net/bugs.php?id=11303
Here's how to recreate the problem...
**** STEP 1:
Point your browser to http://www.analysisandsolutions.com/code/sql/strange.php
This is the source code for that page, if you're interested...
<?php
header("Content-Type: text/plain; charset=ISO-8859-1");
?>
<?php echo "<?php"; ?>
# Comment at TOP
echo "<html><head><title>Strange Behavior</title></head>\n";
echo "<body><p>Echo at top</p>\n";
<?php echo "?>"; ?>
<p>Some HTML in the middle.</p>
<?php echo "<?php"; ?>
# Comment near bottom.
echo "<p>echo near bottom</p>";
<?php echo "?>"; ?>
</body></html>
**** STEP 2:
Save the resulting output to your web server space.
Don't change the file name, file extension or the type of file.
I was using Netscape to view and save the file.
That may or may not be relevant.
FYI, here is a sample of the output.
Don't use this as the script in the next step.
<?php
# Comment at TOP
echo "<html><head><title>Strange Behavior</title></head>\n";
echo "<body><p>Echo at top</p>\n";
?>
<p>Some HTML in the middle.</p>
<?php
# Comment near bottom.
echo "<p>echo near bottom</p>";
?>
</body></html>
**** STEP 3:
Now point your web browser to the copy of strange.php
you saved in your web space.
Then point browser to it and it results in...
# Comment at TOP
# Comment near bottom.
<html><head><title>Strange Behavior</title></head>
<body><p>Echo at top</p>
<p>Some HTML in the middle.</p>
<p>echo near bottom</p>
</body></html>
**** NOTE:
All of the comments are pushed to the beginning of the
program and then displayed. Ouch!
--
Edit Bug report at: http://bugs.php.net/?id=11439&edit=1