mark
Automatically Clean tags within the html tagsNovember 26, 2007 08:07AM |
Hi,
I installed HTML Purifier on my server, it's working fine, great software.
$dirty_html = '<b>Some Text in Here</s>';
<?php require_once 'htmlpurifier-2.1.3/library/HTMLPurifier.auto.php'; $purifier = new HTMLPurifier(); $clean_html = $purifier->purify($dirty_html); echo $clean_html . "\n<br />"; ?>
Is there any way to have HTML Purifier automatically clean the html between the html tags?
<html>all tags to be processed</html>
Thanks
Re: Automatically Clean tags within the html tags November 26, 2007 01:24PM |
Admin Registered: 12 years ago Posts: 3,123 |
Mark
Re: Automatically Clean tags within the html tagsNovember 28, 2007 08:38AM |
Hi,
I have a simple website that is using php include files to insert repeating regions like the header and footer. The person who is updating the content for the website edits the content with Dreamweaver MX and uploads the files. He doesnt know very much about html and always stays in design view. His code nearly always contains a lot of errors and deprecated tags.
Is there any way that I can set HTML Purifier to automatically scan the content between the tags and purfiy the code before it is rendered in the browser?
Thanks :)
Mark
Re: Automatically Clean tags within the html tagsNovember 28, 2007 08:40AM |
Re: Automatically Clean tags within the html tags November 28, 2007 04:31PM |
Admin Registered: 12 years ago Posts: 3,123 |
It's not recommended, because HTML Purifier specifically strips out things like JavaScript and Forms that, while not allowed for user-input, are absolutely necessary for the website itself.
I encourage you to look into HTML Tidy, as well as talking to the developer to get him to learn about semantic markup. :-)