Bug #15160: strip_tags problem with <!-- javascript --> comments inside tags
| From: | martin at humany dot com | Date: | Tue, 22 Jan 2002 12:24:48 +0000 |
| Subject: | Bug #15160: strip_tags problem with <!-- javascript --> comments inside tags | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-77757@lists.php.net to get a copy of this message | ||
From: martin@humany.com
Operating system: Linux 2.4 and Windows XP
PHP version: 4.1.1
PHP Bug Type: Strings related
Bug description: strip_tags problem with <!-- javascript --> comments inside tags
I experienced problems with strip_tags on javascript inside <!-- //-->
brackets that also contains //comments. Below is first two properly
working examples, then a example to reproduce the problem. Tested in both
Windows XP and Linux 2.4, both with PHP 4.1.1
$data = "<br>hello there<!-- comment // --><br>";
$out = strip_tags($data);
echo $out;
//$out = hello there, as expected :)
$data = "<br>hello there<!-- comment --><br>";
$out = strip_tags($data);
echo $out;
//$out = hello there, as expected :)
$data = "<!-- \n".
"function a(i) {\n".
"// comment\n".
"var x=1;\n".
"if (i>1) x=2;\n".
"}\n".
"// -->";
$out = strip_tags($data);
echo $out;
$out now is:
1) x=2;
}
// -->
--
Edit bug report at: http://bugs.php.net/?id=15160&edit=1