#31672 [Ver]: </script> is not considered closing tag if preceded by one-line comment

From: Date: Mon, 24 Jan 2005 03:40:31 +0000
Subject: #31672 [Ver]: </script> is not considered closing tag if preceded by one-line comment
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-72721@lists.php.net to get a copy of this message
 ID:               31672
 Updated by:       sniper@php.net
 Reported By:      tomc at wanadoo dot fr
 Status:           Verified
 Bug Type:         Scripting Engine problem
 Operating System: *
 PHP Version:      4CVS, 5CVS (2005-01-24)
 New Comment:

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 :)



Previous Comments:
------------------------------------------------------------------------

[2005-01-24 02:23:10] sniper@php.net

This is valid bug, all other closing tags ( ?>, %> ) work fine in same
situation, as the provided test case proves.



------------------------------------------------------------------------

[2005-01-23 23:08:59] 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"


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31672&edit=1


Thread (5 messages)

« previous php.bugs (#72721) next »