<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Forums - General</title>
        <description>General discussion about HTML Purifier that isnt asking questions for help.</description>
        <link>http://htmlpurifier.org/phorum/list.php?2</link>
        <lastBuildDate>Thu, 09 Sep 2010 04:26:55 -0700</lastBuildDate>
        <generator>Phorum 5.2.11</generator>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4815,4815#msg-4815</guid>
            <title>style tag (5 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4815,4815#msg-4815</link>
            <description><![CDATA[<p>When attempting to allow the "style" attribute we get an error.</p>

<p>Is there documentation on this or why it is not allowed? (not the tag, the attribute)</p>]]></description>
            <dc:creator>atDev</dc:creator>
            <category>General</category>
            <pubDate>Tue, 31 Aug 2010 05:58:26 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4801,4801#msg-4801</guid>
            <title>Allowed elements input format and style attribute (8 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4801,4801#msg-4801</link>
            <description><![CDATA[<p>The configuration documentation says the AllowedElements should be set as an array.</p>

<p>However when we pass in:
</p>

<pre>
Array
(
    [0] =&gt; p
    [1] =&gt; ul
    [2] =&gt; ol
    [3] =&gt; li
    [4] =&gt; strong
    [5] =&gt; em
    [6] =&gt; u
    [7] =&gt; span
    [8] =&gt; hr
    [9] =&gt; div
    [10] =&gt; br
    [11] =&gt; b
    [13] =&gt; i
)
</pre>

<p>We get errors like:
Element '0' is not supported
Element '1' is not supported
etc.</p>

<p>What format should the input be?
</p>

<pre>
$config-&gt;set('HTML', 'AllowedElements', (array) $tags['tags']);
</pre><p>
$tags['tags'] is the above array.</p>

<p>Secondly how come we can't set 'style' as an attribute so styles can be added to elements?
</p>

<pre>
&lt;font style="..."&gt;
</pre>]]></description>
            <dc:creator>atDev</dc:creator>
            <category>General</category>
            <pubDate>Fri, 03 Sep 2010 23:29:25 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4794,4794#msg-4794</guid>
            <title>Flash embeding problem (13 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4794,4794#msg-4794</link>
            <description><![CDATA[<p>I'm using the latest 4.1.1 version of HTMLPurifier. I turned on "Output.FlashCompat" configuration option to true, but flash video not working properly in Google Chrome and not working at all in Mozilla Firefox. The problem is that HTMLPurifier strips attribute type="application/x-shockwave-flash" and puts embed into &lt;!--[if IE]&gt;&lt;![endif]--&gt; comments.</p>

<p>Another problem appears than I try to resave flash generated by HTMLPurifier. It adds another &lt;!--[if IE]&gt;&lt;embed&gt;&lt;![endif]--&gt; block. So than I save html second time I have 2 &lt;!--[if IE]&gt;&lt;embed&gt;&lt;![endif]--&gt; blocks, than 3 and so on.</p>

<p>Could anybody help me?</p>]]></description>
            <dc:creator>Claus</dc:creator>
            <category>General</category>
            <pubDate>Wed, 08 Sep 2010 20:40:39 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4776,4776#msg-4776</guid>
            <title>Quotes added to property background: url() (2 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4776,4776#msg-4776</link>
            <description><![CDATA[<p>Hello Ambush, </p>

<p>I'm having a problem where style="background-image: url(<a href="http://www.blah.com/image.gif">http://www.blah.com/image.gif</a>);" is begin converted to style="background-image: url("<a href="http://www.blah.com/image.gif">http://www.blah.com/image.gif</a>");" which is creating the problem of double-quotes within double-quotes. Is this a problem with HTML Purifier or am I doing something wrong?</p>

<p>Best,
D4P</p>]]></description>
            <dc:creator>D4P</dc:creator>
            <category>General</category>
            <pubDate>Thu, 05 Aug 2010 00:55:35 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4767,4767#msg-4767</guid>
            <title>Disallow all (2 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4767,4767#msg-4767</link>
            <description><![CDATA[<p>Hello</p>

<p>Is there an easy way to disallow everything by default?</p>]]></description>
            <dc:creator>arekanderu</dc:creator>
            <category>General</category>
            <pubDate>Tue, 27 Jul 2010 11:26:08 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4715,4715#msg-4715</guid>
            <title>Allowing SCRIPT tag from whitelisted SRC? (5 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4715,4715#msg-4715</link>
            <description><![CDATA[<p>Hey all --</p>

<p>I have a question regarding HTMLPurifier that a thorough read of the (very good, btw) docs has not helped me find a solution to.  So I figured I would turn to the experts :D</p>

<p>I have a client whose CMS is using HTMLPurifier to filter user-generated content.  They are interested in allowing users to include widgets provided by a third party, who provides users with an "embed code" for the widgets that employs the SCRIPT tag, with the SRC attribute pointing to a JavaScript file hosted by the third party.  (In some ways therefore this is similar to the problem of embedding videos from sites like YouTube.)</p>

<p>My thought was that it would be OK to allow this as long as SCRIPT is strictly set to only be included if the SRC is pointing to a valid, whitelisted domain that we know belongs to the third party.  But the problem I've run into in implementing this is that I have not been able to find a way to get HTMLPurifier to allow SCRIPT tags _at all_ except by setting <a href="/live/configdoc/plain.html#HTML.Trusted">%HTML.Trusted</a> to true. (I tried adding SCRIPT to the list of tags in <a href="/live/configdoc/plain.html#HTML.AllowedElements">%HTML.AllowedElements</a> and adding the Scripting module via <a href="/live/configdoc/plain.html#HTML.AllowedModules">%HTML.AllowedModules</a>, but neither allowed the tag through.)</p>

<p>Setting <a href="/live/configdoc/plain.html#HTML.Trusted">%HTML.Trusted</a> to true appears to pass the tag through, but this approach makes me nervous because turning Trusted on seems to relax a bunch of other constraints as well, so using it to solve this problem feels a bit like swatting a fly with a shovel.</p>

<p>I can't do anything with whitelisting by SRC until I can get HTMLPurifier to allow SCRIPT tags through, though. So my question is: is there a way to solve this problem without resorting to <a href="/live/configdoc/plain.html#HTML.Trusted">%HTML.Trusted</a>?</p>

<p>Thanks in advance for any help!</p>

<p>-- Jason Lefkowitz</p>]]></description>
            <dc:creator>jalefkowit</dc:creator>
            <category>General</category>
            <pubDate>Mon, 19 Jul 2010 10:17:49 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4580,4580#msg-4580</guid>
            <title>Maintaining newlines in table HTML (2 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4580,4580#msg-4580</link>
            <description><![CDATA[<p>The html</p>

<pre>
&lt;table&gt;
 &lt;tr&gt;
  &lt;td&gt;foo&lt;/td&gt;
 &lt;/tr&gt;
&lt;/table&gt;
</pre>

<p>gets converted to</p>

<pre>
&lt;table&gt;&lt;tr&gt;&lt;td&gt;foo&lt;/td&gt;
 &lt;/tr&gt;&lt;/table&gt;
</pre>

<p>by the purifier. It seems to only maintain indentation on closing tags. Is there anyway to get it to maintain indents for the opening "table" and "tr" tags?</p>]]></description>
            <dc:creator>Brett Gardner</dc:creator>
            <category>General</category>
            <pubDate>Sun, 23 May 2010 23:19:06 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4548,4548#msg-4548</guid>
            <title>Core.CollectErrors: Status? (5 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4548,4548#msg-4548</link>
            <description><![CDATA[<p>Just a quick question about development tasks not outlined in <a href="http://htmlpurifier.org/live/TODO">your TODO</a>:</p>

<p>I was wondering what the current status re: Core.CollectErrors is - is there a chance the feature might be completed in the near future, or is it low-priority? :)</p>

<p>(I'm already using it in its current form, but would need completion for my project. As an example, when...</p>

<pre>
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;blah&lt;/title&gt;
  &lt;/head&gt;
  &lt;body style="background-color:#000000; color:#ffffff;"&gt;
    &lt;div&gt;Something.&lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre>

<p>...is turned into...</p>

<pre>
&lt;div&gt;Something.&lt;/div&gt;
</pre>

<p>...because the ruleset does not allow for 'head' and 'body' and 'html' tags, then there's no notification.)</p>]]></description>
            <dc:creator>pinkgothic</dc:creator>
            <category>General</category>
            <pubDate>Wed, 05 May 2010 05:15:22 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4544,4544#msg-4544</guid>
            <title>Custom HTML elements. (3 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4544,4544#msg-4544</link>
            <description><![CDATA[<p>I've got a question about adding a custom html element. I have a php class that parses output looking for custom html elements. For example</p>

<pre>&lt;ctag:pagination per_page="10" /&gt;</pre>

<p>I've tried adding `ctag:pagination` to HTML.Allowed and `ctag:pagination.*` to HTML.AllowedAttributes, however I get the error</p>

<pre>
Notice: Cannot allow attribute '*' if element 'ctag:pagination' is not allowed/supported (for information on implementing this, see the support forums) in /Users/ollie/Sites/SacrificeApp/Sacrifice/application/vendors/HTMLPurifier/HTMLPurifier/HTMLDefinition.php  on line 316
</pre>

<p>Am I doing something wrong. Can custom html elements not be added?</p>]]></description>
            <dc:creator>buggedcom</dc:creator>
            <category>General</category>
            <pubDate>Mon, 03 May 2010 11:08:14 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4523,4523#msg-4523</guid>
            <title>HTML5 Support? (7 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4523,4523#msg-4523</link>
            <description><![CDATA[<p>Hi,</p>

<p>when will HTML Purifier support HTML5? For example tags like ,  and end tags without slashes e.g. ?</p>]]></description>
            <dc:creator>Peter Nguyen</dc:creator>
            <category>General</category>
            <pubDate>Tue, 22 Jun 2010 16:08:58 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4483,4483#msg-4483</guid>
            <title>HTML Trigger (3 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4483,4483#msg-4483</link>
            <description><![CDATA[<p>I have been working on optimizing phpinputvalidator.  One of the speed issues I have found is HTML Purifier.  Obviously with the large over head it is no ideal to use it when it's not needed.  You can configure it so it is only used when you tell to use it.  But I would like to refine it even more.</p>

<p>Would it be good from a security and a purification standpoint to only trigger HTML purifier if say a &lt; is found?  The thought being that if there is not a &lt; then the string shouldn't have any html thus shouldnt need to be run through purifier.</p>]]></description>
            <dc:creator>Technocrat</dc:creator>
            <category>General</category>
            <pubDate>Fri, 16 Apr 2010 09:53:43 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4424,4424#msg-4424</guid>
            <title>Flash without filtering attributes and etc (4 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4424,4424#msg-4424</link>
            <description><![CDATA[<p>Hello.
Could you advice me, how I could disable filtering flash video?
Cuz it has many bugs in HTML Purifier. It filters other tags good, but flash is very bad, many players doesnt work.
Even videos from youtube are incorrect after parsing: I cant use fullscreen and cant click on youtube logo. I have many other examples with different players from different sites.
So, the question is next: how I could say parser, that flash video must be processed with only simple checks like cutting js in attribute onlick?
I dont want that parser checks allowed attributes and many other checks.
How I could perform it, Mr.Ambush Commander? :) Its very important for me and I really dont know how to solve this problem.
Thx.</p>]]></description>
            <dc:creator>rocker</dc:creator>
            <category>General</category>
            <pubDate>Mon, 05 Apr 2010 08:53:20 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4419,4419#msg-4419</guid>
            <title>Preserve and export text but still protect - how? (7 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4419,4419#msg-4419</link>
            <description><![CDATA[<p>I need to allow users to enter text data into a form and then load that data into a mysql db and then extract that same data for various print jobs.</p>

<p>Thus, the characters that go in must be exactly the same as what is extracted for the print job.</p>

<p>However, of course I'd like to ensure that the data on the server (from upload through extraction) is filtered/cleaned</p>

<p>Is there a way to allow all kinds of characters, extract them exactly the same, but protect the system too?</p>

<p>I know you can filter going in, just not sure how I'd get it all out the same and still keep the system happy.</p>

<p>Thanks so much :-)</p>]]></description>
            <dc:creator>scanreg</dc:creator>
            <category>General</category>
            <pubDate>Mon, 29 Mar 2010 09:55:59 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4391,4391#msg-4391</guid>
            <title>Using filters without cleaning (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4391,4391#msg-4391</link>
            <description><![CDATA[<p>After days of trying to configure purifier to clean our html we realized that it was not possible (stripping out forms and all other data we need - this is absurd btw. There are people out there who just want to clean their code as they go from one CMS to another for example). Unfortunately we already wrote complex filters for url and images. Is there a way to keep these without having any stripping/modifying going on?  I figured we'll just have to write our own regex to do what we need as far as cleaning the html</p>

<p>Thanks</p>]]></description>
            <dc:creator>Joshua</dc:creator>
            <category>General</category>
            <pubDate>Tue, 16 Mar 2010 13:29:22 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4335,4335#msg-4335</guid>
            <title>You tube filter + allowed tags trouble (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4335,4335#msg-4335</link>
            <description><![CDATA[<p>Hi,
I'm new at HP so be patience :)
I don't see why this snippet don't get rid of
the last div :(
</p>

<pre>
function cleanComments($user_input_data)
{
  $purifier = new HTMLPurifier();
$purfier_config = HTMLPurifier_Config::createDefault();
$purfier_config-&gt;set('HTML.DefinitionID', 'User Content Filter');
$purfier_config-&gt;set('HTML.DefinitionRev', 1);
// these are allowed html tags, means white list
$purfier_config-&gt;set('HTML.Allowed', 'a,strong,em,p,span,img,li,ul,ol,sup,sub,small,big,code,blockquote,h1,h2,h3,h4,h5');
// these are allowed html attributes, coool!
$purfier_config-&gt;set('HTML.AllowedAttributes', 'a.href,a.title,span.style,span.class,span.id,p.style,img.src,img.style,img.alt,img.title,img.width,img.height');
// auto link given url string
$purfier_config-&gt;set('AutoFormat.Linkify', true);
// auto format \r\n lines
//$purfier_config-&gt;set('AutoFormat.AutoParagraph', true);
// clean empty tags
$purfier_config-&gt;set('AutoFormat.RemoveEmpty', true);
// cache dir, just for symfony of course, you can change to another path
//$purfier_config-&gt;set('Cache.SerializerPath', sfConfig::get('sf_cache_dir'));
// translation type, 
$purfier_config-&gt;set('HTML.Doctype', 'XHTML 1.0 Transitional');
// allow youtube videos
$purfier_config-&gt;set('Filter.YouTube', true);
$purfier_config-&gt;set('HTML.TidyLevel', 'heavy');
// now clean your data
$cleanHtml = $purifier-&gt;purify($user_input_data, $purfier_config);
  return $cleanHtml;
}
$html = '&lt;object width="425" height="350"&gt;&lt;param name="movie" value="<a href="http://www.youtube.com/v/BdU--T8rLns">http://www.youtube.com/v/BdU--T8rLns</a>"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="<a href="http://www.youtube.com/v/BdU--T8rLns">http://www.youtube.com/v/BdU--T8rLns</a>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;a&gt;';
$html .= ' kkkk &lt;a href="<a href="http://www.google.it/">http://www.google.it/</a>"&gt;pippo&lt;/a&gt;&lt;p&gt;pippo&lt;/p&gt;&lt;em&gt;ddd&lt;/em&gt;&lt;div&gt;pippo&lt;/div&gt;'; 
echo(cleanComments($html));
</pre><p>
Bye</p>]]></description>
            <dc:creator>Whisher</dc:creator>
            <category>General</category>
            <pubDate>Mon, 08 Mar 2010 12:37:03 -0800</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4301,4301#msg-4301</guid>
            <title>Default Configuration (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4301,4301#msg-4301</link>
            <description><![CDATA[<p>Hello All,</p>

<p>What is the the default configuration for HTMLpurifier? ie: what tags are stripped ...etc</p>

<p>can u list the default configuration please :)!</p>

<p>Thanks,
Kayed Qunibi</p>]]></description>
            <dc:creator>dynamic</dc:creator>
            <category>General</category>
            <pubDate>Tue, 16 Feb 2010 08:12:39 -0800</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4234,4234#msg-4234</guid>
            <title>HTMLPurifier + Markdown -&gt; A lot of empty p tags (2 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4234,4234#msg-4234</link>
            <description><![CDATA[<p>Hello everybody,
I am creating my own minimalist blog engine using codeigniter. I added HTMLPurifier and if works fine. I also use Markdown. I will post here the plugin I use and some code to illustrate my problem:</p>

<p>The plugin: htmlpurifier_pi.php:
</p>

<pre>
function purify($html)
{
	if (empty($html) || trim((string)$html) === '')
	{
		log_message('error','htmlpurifier_pi::purify : The html you sent to the HTML Purifier is empty...I wonder how is that possible...');
		return FALSE;
	}
	
	if (is_array($html))
	{
		foreach ($html as $key =&gt; $value)
		{
			$html[$key] = purify($value);
		}
		
		return $html;
	}
	else
	{
		require_once(APPPATH . 'plugins/htmlpurifier/HTMLPurifier.standalone.php'); 
		
		$allowed_tags = 'p,em,i,strong,b,a[href],ul,ol,li,code,pre,blockquote';
		
		$config = HTMLPurifier_Config::createDefault();
		$config-&gt;set('HTML.Doctype', 'XHTML 1.0 Strict');
		$config-&gt;set('HTML.Allowed', $allowed_tags);
		$config-&gt;set('HTML.TidyLevel', 'heavy');
		$config-&gt;set('AutoFormat.Linkify', 'true');
		$config-&gt;set('AutoFormat.AutoParagraph', 'true');
		$htmlpurifier = new HTMLPurifier($config);
		
		log_message('debug','HTML Purified!');
		return $htmlpurifier-&gt;purify($html);
	}
} // End of purify
</pre>

<p>The example: 
</p>

<pre>
$this-&gt;load-&gt;plugin('htmlpurifier_pi.php');
$body = purify(markdown($this-&gt;input-&gt;post('body')));
</pre>

<p>Now if I post the following comment: </p>

<pre>
This is a list:

* This is a list item
* This is another list item

1. This is the first item of an ordered list
2. This is the second item of an ordered list

Quote:

&gt; Only idiots
&gt; never change their minds
</pre>

<p>Here is the code that I get:</p>

<pre>
&lt;p&gt;This is a list:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;This is a list item&lt;/li&gt;
&lt;li&gt;This is another list item&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;&lt;li&gt;This is the first item of an ordered list&lt;/li&gt;
&lt;li&gt;This is the second item of an ordered list&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Quote:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Only idiots
  never change their minds&lt;/p&gt;
&lt;/blockquote&gt;
</pre>

<p>See? I get a bunch of empty p tags. How could I get rid of those p tags please?</p>]]></description>
            <dc:creator>AzizLight</dc:creator>
            <category>General</category>
            <pubDate>Sun, 17 Jan 2010 10:06:04 -0800</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4232,4232#msg-4232</guid>
            <title>WYSIWYG or Rich Editor Demo Available? (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4232,4232#msg-4232</link>
            <description><![CDATA[<p>Greetings,</p>

<p>I hope this is the right forum to ask this question, so here goes...</p>

<p>I'm considering using the Phorum software along with <strong>HTML Purifier</strong> primarily so I can integrate a WYSIWYG editor like CKEditor or YUI. Is there a demo site utilizing such a configuration that anyone can direct me to? I don't want to force my users to know and type arcane mark-up. If anyone can point me in the direction of a demo site, I'd greatly appreciate it.</p>

<p>Thanks,</p>

<p>-Steve</p>]]></description>
            <dc:creator>Shotster</dc:creator>
            <category>General</category>
            <pubDate>Sun, 17 Jan 2010 01:17:42 -0800</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4196,4196#msg-4196</guid>
            <title>Would this be suited for... (3 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4196,4196#msg-4196</link>
            <description><![CDATA[<p>Hello,</p>

<p>I have been looking into ways to overcome a problem I have with my website and wondered if I could ask you for some more details.</p>

<p>Basically I am coding a website in which I want to allow members of my site to post html/css so they can decorate their profile backgrounds, pages etc!</p>

<p>However I am aware that you can sanitise user input but am confused as to the allowing html, etc!</p>

<p>So by using this script would this ensure that the user input is made safe? </p>

<p>I would want to allow users to use things like <a> etc but not necessarily tables and stuff.

Thanks</a></p>]]></description>
            <dc:creator>Justin</dc:creator>
            <category>General</category>
            <pubDate>Thu, 31 Dec 2009 13:54:29 -0800</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4180,4180#msg-4180</guid>
            <title>Question to html purifier experts (5 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4180,4180#msg-4180</link>
            <description><![CDATA[<p>Hi!</p>

<p>I am thinking of this idea to write something like html purifier, basically I want to know your opinion of what's wrong with doing it this way: 3 basic steps</p>

<p>1) Convert charset encoding to utf8, like this: if charset is already reported as utf-8 or ascii, then
validate that it does not contain illegal chars and strip low bytecode chars (except tab, newline and space)
If utf8 does not pass the test for well-formdness, then recode it using iconv UTF-8 to UTF-8 with //IGNORE flag or similarly can use mb_convert_encoding using the "none" as default character
If charset is anything other than utf8 then convert it to utf8 using either utf8_encode or iconv or mb_convert_encoding, depending on what extension is available and of cause utf8_encode only works on latin1</p>

<p>2) Fix the html string by running it through Tidy. This will take care of closing unclosed tags, can also remove garbage from MS-Word created HTML. It will also add necessary &lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt; to the html fragment.</p>

<p>3) The actual stripping off the dangerous tags: do with with DOMDocument/DOMElement classes of php. Since by now we have valid UTF-8 string and fixed HTML, we should be able to load the document into DOMDocument without problems.</p>

<p>Now we can use DOM interface or even Xpath to find all tags that are not on our whitelist (or on our blacklist), and can also find all tags that have dangerous attributes and remove all of them.</p>

<p>The DOMElement removes all decendents, so nesting is solved right there.</p>

<p>Now we have the clean DOMDocument and can dump it back as a string, there are also some tricks to only dump the contents of what's inside the  tag, so the actual &lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt; will not be included in the result if we don't want that.</p>

<p>This looks easy and uses only the extensions that are already in php - mbstring or iconv, tidy and DOM</p>

<p>What's your take on this approach?</p>]]></description>
            <dc:creator>Dmitri</dc:creator>
            <category>General</category>
            <pubDate>Wed, 23 Dec 2009 10:55:33 -0800</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4178,4178#msg-4178</guid>
            <title>About utf8 charset validation (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4178,4178#msg-4178</link>
            <description><![CDATA[<p>Question about utf8
Does the purifier validate that string contains only the valid utf-8 chars? 
I know that this type of validation may be time consuming.</p>

<p>I already have written my own utf-8 sanitizor class that validates and recodes the utf-8 string if necessary, so I am 100% confident that my string is 100% utf-8</p>

<p>Is there a way for me to tell the purifier to skip its' charset validation and only do the html tags related work?</p>

<p>So basically I have already done the charset validation/sanitization, and I only need to remove dangerous html tags and maybe fix the bad html.</p>]]></description>
            <dc:creator>Dmitri</dc:creator>
            <category>General</category>
            <pubDate>Tue, 22 Dec 2009 18:53:18 -0800</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4061,4061#msg-4061</guid>
            <title>Could I use HTML Purifier on my website? (2 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4061,4061#msg-4061</link>
            <description><![CDATA[<p>Hi,</p>

<p>Could I use this great programme on my website and forums at <a href="http://www.codesupplier.com/">http://www.codesupplier.com/</a> and <a href="http://www.codesupplier.com/apps/forums/">http://www.codesupplier.com/apps/forums/</a> or not? Please tell me... Thanks.</p>

<p>Cheers!</p>]]></description>
            <dc:creator>codesupplier.com</dc:creator>
            <category>General</category>
            <pubDate>Sat, 31 Oct 2009 12:08:17 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,4039,4039#msg-4039</guid>
            <title>Has HTML purifier it's own editor??? (2 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,4039,4039#msg-4039</link>
            <description><![CDATA[<p>Hi, i've read that HTMLpurifier had also it's own editor WYSIWYG of a very good quality. But i don't seem able to find it. So, i wonder if what i've read is true and if yes, where can i find it? Thanks, 
laetitia.</p>]]></description>
            <dc:creator>titia</dc:creator>
            <category>General</category>
            <pubDate>Thu, 15 Oct 2009 15:04:20 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,3945,3945#msg-3945</guid>
            <title>Remove ascii character 160 from HTML (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,3945,3945#msg-3945</link>
            <description><![CDATA[<p>How to remove ascii character 160 which shows up as a space on the Firefox 3.0 from HTML?</p>

<p>Thanks in advance</p>

<p>CSJakharia</p>]]></description>
            <dc:creator>csplrj</dc:creator>
            <category>General</category>
            <pubDate>Sun, 30 Aug 2009 11:01:26 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,3944,3944#msg-3944</guid>
            <title>What is the way to remove all whitespace and &amp;nbsp; from the HTML (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,3944,3944#msg-3944</link>
            <description><![CDATA[<p>What is the way to remove all whitespace and   from the HTML?</p>

<p>I tried this  but then also values in the attribute does not remove spaces
	$config = HTMLPurifier_Config::createDefault();
	$config-&gt;set('HTML.Doctype', 'XHTML 1.0 Transitional');
	$config-&gt;set('HTML.TidyLevel', 'heavy');
	$config-&gt;set('Attr.EnableID', true);
	$config-&gt;set('AutoFormat.RemoveEmpty.RemoveNbsp', true);
	$config-&gt;set('AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions',array());</p>

<p>
	$obj = new HTMLPurifier($config);</p>

<p>But this does not converts </p>

<pre>
&lt;span style="color:#ffffff;font-family:arial;font-size:small;"&gt;&lt;b&gt;  Type&lt;/b&gt;&lt;/span&gt;
</pre>

<p>to </p>

<pre>
&lt;span style="color:#ffffff;font-family:arial;font-size:small;"&gt;&lt;b&gt;Type&lt;/b&gt;&lt;/span&gt;
</pre>

<p>It does not removes extra trailing spaces</p>

<p>Thanks in advance</p>

<p>CSJakharia</p>]]></description>
            <dc:creator>csplrj</dc:creator>
            <category>General</category>
            <pubDate>Sun, 30 Aug 2009 10:59:57 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,3926,3926#msg-3926</guid>
            <title>custom whitelist? (2 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,3926,3926#msg-3926</link>
            <description><![CDATA[<p>I want to use htmlpurifier in such a way that only a strict subset of tags and attributes are allowed.  Where and how can I specify the list of html tags and attributes that I want to allow (so that ALL other tags and attributes get immediately filtered out).  Thanks.</p>]]></description>
            <dc:creator>es555</dc:creator>
            <category>General</category>
            <pubDate>Thu, 20 Aug 2009 07:45:14 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,3886,3886#msg-3886</guid>
            <title>Generic video/embed filter? (62 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,3886,3886#msg-3886</link>
            <description><![CDATA[<p>I have read over oodles of posts here and have been unable to find exactly what i'm looking for. I'm looking for something more generic than the YouTube filter in the core of HTMLPurify. The reason for this is I need to support numerous videos, most of the sites would be unknown. Additionally, supporting the flashvars tag is imperative. </p>

<p>Can anyone provide any insight on this?  </p>

<p>As it stands now, I have this config and flashvars is filtered out:
</p>

<pre>
require_once 'HTMLPurifier.auto.php';
$config = HTMLPurifier_Config::createDefault();
$config-&gt;set('Core.Encoding', 'UTF-8');
$config-&gt;set('HTML.Doctype', 'XHTML 1.0 Transitional');
// $config-&gt;set('Output.TidyFormat', true);
$config-&gt;set('AutoFormat.AutoParagraph', true);
$config-&gt;set('AutoFormat.DisplayLinkURI', true);
$config-&gt;set('AutoFormat.Linkify', true);
$config-&gt;set('AutoFormat.RemoveEmpty', true);
$config-&gt;set('AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions', array('td', 'th'));
$config-&gt;set('AutoFormat.RemoveEmpty.RemoveNbsp', true);
$config-&gt;set('HTML.SafeObject', true);
$config-&gt;set('HTML.SafeEmbed', true);
$config-&gt;set('HTML.Trusted', true);
$config-&gt;set('HTML.TidyLevel', 'light');
$config-&gt;set('HTML.EnableAttrID', true);
// $config-&gt;set('HTML.Allowed', 'flashvars', 'object', 'embed', 'param');
$config-&gt;set('HTML.Allowed', array('param', 'object', 'embed', 'flashvars'));
$config-&gt;set('Cache.SerializerPath', Base::clientPath().Cache::DIRECTORY);
$config-&gt;set('Filter.YouTube', true);
// $config-&gt;set('Filter.Embed', true);
// $config-&gt;set('Filter.Playlist', true);

$purifier = new HTMLPurifier($config);
$this-&gt;post_data[$var_name] = $purifier-&gt;purify($post_value);
</pre>

<p>On a side note, I was _trying_ to write my own filter, but could never get it to run. Is there something I need to do to activate the plugin?</p>]]></description>
            <dc:creator>zmonteca</dc:creator>
            <category>General</category>
            <pubDate>Sun, 20 Jun 2010 18:17:28 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,3877,3877#msg-3877</guid>
            <title>phpInputValidator (5 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,3877,3877#msg-3877</link>
            <description><![CDATA[<p>Hey,</p>

<p>I was wonder if you had time if you could take a look at a project I have been working on to validate php input and give me any feed back.  It can work in conjunction with HTMLPurifier.</p>

<p><a href="https://www.assembla.com/wiki/show/phpInputValidator/">https://www.assembla.com/wiki/show/phpInputValidator/</a></p>

<p>Thanks</p>]]></description>
            <dc:creator>Technocrat</dc:creator>
            <category>General</category>
            <pubDate>Thu, 13 Aug 2009 12:17:59 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,3857,3857#msg-3857</guid>
            <title>height attribute on &lt;table&gt; removed (8 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,3857,3857#msg-3857</link>
            <description><![CDATA[<p>Hello,</p>

<p>I'm trying to allow the "height" attribute on the table element, and I can't seem to get it to work properly. </p>

<p>My config is this:
</p>

<pre>

		$config-&gt;set('Core', 'Encoding', 'ISO-8859-1');
		$config-&gt;set('Core', 'CollectErrors', true);
		$config-&gt;set('HTML', 'Doctype', 'XHTML 1.0 Transitional');
		$config-&gt;set('Core', 'EscapeNonASCIICharacters', true);
		$config-&gt;set('Core', 'EscapeInvalidTags', true);
		$config-&gt;set('HTML', 'Trusted', true);
		$config-&gt;set('HTML', 'SafeObject', true);
		$config-&gt;set('HTML', 'SafeEmbed', true);
		$config-&gt;set('HTML', 'EnableAttrID', true);
		$config-&gt;set('HTML', 'TidyLevel', 'medium');
		$config-&gt;set('Filter', 'YouTube', true);
		$config-&gt;set('Cache', 'DefinitionImpl', null); // remove this later!
				
		$config-&gt;set('HTML', 'DefinitionID', '1');
		$config-&gt;set('HTML', 'DefinitionRev', 2);

$def =&amp; $config-&gt;getHTMLDefinition(true);
$def-&gt;addAttribute('table', 'height', new HTMLPurifier_AttrDef_Enum(array(0 =&gt; '*')));

</pre>

<p>I have tried to define the value array in multiple ways, but nothing seems to work.  If anybody sees what I'm doing wrong, I'd appreciate the input.</p>]]></description>
            <dc:creator>DP</dc:creator>
            <category>General</category>
            <pubDate>Wed, 22 Jul 2009 12:23:11 -0700</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?2,3823,3823#msg-3823</guid>
            <title>RSS (4 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?2,3823,3823#msg-3823</link>
            <description><![CDATA[<p>First nice work on v4.  I like the improvements.</p>

<p>Would it be possible to create an RSS feed for your news or releases?  I would like to keep up to date on your releases since I am using it on 3 projects.  I hate blindly coming to the site wondering if there is a new release or not.</p>

<p>Thanks!</p>]]></description>
            <dc:creator>Technocrat</dc:creator>
            <category>General</category>
            <pubDate>Thu, 16 Jul 2009 09:13:07 -0700</pubDate>
        </item>
    </channel>
</rss>
