ID: 15160
Updated by: sander
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Strings related
Operating System: Linux 2.4 and Windows XP
PHP Version: 4.1.1
New Comment:

strip_tags removes everything between < and the _first_ occurence of >
If you have "<abc> >" it returns " >".
Not a bug.
If you want to remove a whole comment, you need to use a regex.


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

[2002-01-22 07:24:47] [EMAIL PROTECTED]

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 this bug report at http://bugs.php.net/?id=15160&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to