From:             barce at cyphgen dot com
Operating system: SuSE Linux 7.0 and FreeBSD 4.8
PHP version:      4.3.2
PHP Bug Type:     Output Control
Bug description:  Comments are parsed incorrectly causing code to be displayed

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>


-- 
Edit bug report at http://bugs.php.net/?id=25153&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25153&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25153&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25153&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25153&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25153&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25153&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25153&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25153&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25153&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25153&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25153&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25153&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25153&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25153&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25153&r=gnused

Reply via email to