php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #31672 [PATCH] </script> is not considered closing tag if preceded by one-line comment
Submitted: 2005-01-23 23:08 UTC Modified: 2005-03-31 23:14 UTC
From: tomc at wanadoo dot fr Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4CVS, 5CVS (2005-01-24) OS: *
Private report: No CVE-ID: None
 [2005-01-23 23:08 UTC] tomc at wanadoo dot fr
Description:
------------
in the manual :
"The one-line comment styles actually only comment to the end of the line or the current block of PHP code, whichever comes first."

Everything is working as described in the manual except that if you are using the </script> closing tag, PHP will consider the end of the PHP block as part of the comment.

Reproduce code:
---------------
<?php // line comment ?>
echo "out of PHP"
<? // line comment ?>
echo "out of PHP"
<% // line comment %>
echo "out of PHP"
<script language="php">// line comment</script>
echo "how come I'm still in PHP ?\n" ;
</script>
echo "out of PHP"

Expected result:
----------------
echo "out of PHP"
echo "out of PHP"
echo "out of PHP"
echo "how come I'm still in PHP ?\n" ;
echo "out of PHP"

Actual result:
--------------
echo "out of PHP"
echo "out of PHP"
echo "out of PHP"
how come I'm still in PHP ?
echo "out of PHP"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-24 02:23 UTC] sniper@php.net
This is valid bug, all other closing tags ( ?>, %> ) work fine in same situation, as the provided test case proves.


 [2005-01-24 04:40 UTC] sniper@php.net
I'm not any flex guru, but this patch fixes the problem:
http://www.php.net/~jani/patches/bug31672.patch

(need to get some guru to approve this one :)

 [2005-02-25 16:59 UTC] andi@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2005-03-07 17:54 UTC] zeev@php.net
Fixing this appears to open a can of worms.  The fix was reverted.

Changing to a documentation issue - we need to change the docs to reflect that </script> doesn't end scripting within a one line comment.
 [2005-03-31 23:14 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

"However, </script> tag doesn't escape PHP mode in one-line comment."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC