php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25153 Comments are parsed incorrectly causing code to be displayed
Submitted: 2003-08-19 12:33 UTC Modified: 2003-08-19 12:36 UTC
From: barce at cyphgen dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.3.2 OS: SuSE Linux 7.0 and FreeBSD 4.8
Private report: No CVE-ID: None
 [2003-08-19 12:33 UTC] barce at cyphgen dot com
Description:
------------
While trying to write valid html 4.01, I commented out an XML tag placed in an echo statement. This caused PHP to print out php code instead of html.



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

# echo "<?xml version=\"1.0\"?> ";
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";

?>

<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
test
</body>
</html>

Expected result:
----------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
test
</body>
</html>


Actual result:
--------------
 ";
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";

?>

<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
test
</body>
</html>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-19 12:36 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

I suggest that you read the manual on commenting again.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun May 22 03:03:34 2022 UTC