|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-01-22 14:29 UTC] sander@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 07:00:01 2025 UTC |
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; } // -->