} } } } } } } else { if ($tagname === "/b" || $tagname === "/strong" || $tagname === "/i" || $tagname === "/ul" || $tagname === "/ol" || $tagname === "/li") { if (trim($content) === "") { return array("keep_tag" => false); } } } return array(); } $options = TagFilter::GetHTMLOptions(); $options["tag_callback"] = "TestHTMLTagFilter"; echo "Testing XSS removal\n"; echo "-------------------\n"; $testfile = file_get_contents("test_xss.txt"); $pos = strpos($testfile, "@EXIT@"); if ($pos === false) { $pos = strlen($testfile); } $testfile = substr($testfile, 0, $pos); $result = TagFilter::Run($testfile, $options); echo $result . "\n\n"; echo "-------------------\n\n"; echo "Testing Word HTML cleanup\n"; echo "-------------------------\n"; $testfile = file_get_contents("test_word.txt");