<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Forums - Support</title>
        <description>Questions about using HTML Purifier answered here. No problem is too small.</description>
        <link>http://htmlpurifier.org/phorum/list.php?3</link>
        <lastBuildDate>Mon, 20 May 2013 07:55:22 -0400</lastBuildDate>
        <generator>Phorum 5.2.18</generator>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6959,6959#msg-6959</guid>
            <title>Compatibility with splclassloader or any autoloader (3 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6959,6959#msg-6959</link>
            <description><![CDATA[<p>I'm using this autoloader (<a href="https://gist.github.com/jwage/221634">https://gist.github.com/jwage/221634</a>).</p>

<p>1. Won't the HTML Purifier's autoloader conflict with my autoloader? </p>
<p>2. Is the HTML Purifier standalone version the one to use if I have my own autoloader?</p>

<p>I've read the documentation and can't quite figure it out.</p>

<p>Edited 1 time(s). Last edit at 05/09/2013 02:37AM by tonex.</p>]]></description>
            <dc:creator>tonex</dc:creator>
            <category>Support</category>
            <pubDate>Tue, 14 May 2013 08:21:03 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6947,6947#msg-6947</guid>
            <title>How to embed CBS News Video? (7 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6947,6947#msg-6947</link>
            <description><![CDATA[<p>I got the embed code below from <a href="http://www.cbsnews.com/video/watch/?id=50145567n.">http://www.cbsnews.com/video/watch/?id=50145567n.</a>  No matter what setting I use, I can't get the video to display.  How should I configure HTMLPurifier to allow this video?</p>

<pre>
&lt;embed src="<a href="http://cnettv.cnet.com/av/video/cbsnews/atlantis2/cbsnews_player_embed.swf">http://cnettv.cnet.com/av/video/cbsnews/atlantis2/cbsnews_player_embed.swf</a>" type="application/x-shockwave-flash" background="#333333" width="425" height="279" allowFullScreen="true" allowScriptAccess="always" FlashVars="si=254&amp;contentValue=50145567&amp;shareUrl=<a href="http://www.cbsnews.com/video/watch/?id=50145567n">http://www.cbsnews.com/video/watch/?id=50145567n</a>" /&gt;
</pre>]]></description>
            <dc:creator>AnHTMLPurifierUser</dc:creator>
            <category>Support</category>
            <pubDate>Mon, 29 Apr 2013 17:57:30 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6939,6939#msg-6939</guid>
            <title>Pear-Version for release 4.5.0 (3 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6939,6939#msg-6939</link>
            <description><![CDATA[<p>Hello!</p>

<p>Upon packaging the latest version of your great software for opensuse, I have recognized that the Pear packages in the /get directory are somehow wrong. They are very big (more then twice as big as the previous release) and can't be unpackacked.</p>

<p>In the previous release I have recognized several '*.bak' files within the package, which should also be removed.</p>

<p>I kindly request to check the packages...</p>

<p>Best regards,
Johannes</p>]]></description>
            <dc:creator>jweberhofer</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 25 Apr 2013 17:10:50 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6931,6931#msg-6931</guid>
            <title>HTML Purifier stops working (6 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6931,6931#msg-6931</link>
            <description><![CDATA[<p>I've recently starting HTML Purifier on my website, I install in and the necessary PHP and it works perfectly. Then the next day when I try to use any of my forms HTML Purfifier causes them to break. I remove the library, reload it, and the problem is fixed but for only a day at most. I can't keep downloading the library fresh every day, and I have no idea what would cause this.</p>

<p>My site is written in PHP in the Zend Framework running on Godaddy Linux hosting. Here's the code:
</p>

<pre>
require_once 'libraries/htmlpurifier-4.5.0/library/HTMLPurifier.auto.php';
$config = HTMLPurifier_Config::createDefault();
$purifier = new HTMLPurifier($config);            
$username = $_POST['loginUsername'];
$password = $_POST['loginPassword'];       
// After the above lines execute the site just keeps trying to load with no results.
$clean_username = $purifier-&gt;purify($username);     
$clean_password = $purifier-&gt;purify($password);
</pre>

<p>I've previously been having good luck with your library, and commend you on it. This is the first issue I've had, and first post on the forum so bear with me if you need more information. Thanks in advance.</p>]]></description>
            <dc:creator>lostphilosopher</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 18 Apr 2013 11:45:20 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6927,6927#msg-6927</guid>
            <title>Allow youtube iframes (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6927,6927#msg-6927</link>
            <description><![CDATA[<p>Hello</p>

<p>How do I allow ONLY youtube or vimeo iframes</p>

<p>I have these </p>

<pre>
$config-&gt;set('HTML.AllowedElements', array('a','b','p','i','em','u', 'br', 'div', 'img', 'strong','iframe'));
$config-&gt;set('HTML.AllowedAttributes', array('a.href', 'img.src', '*.alt', '*.title', '*.border', 'a.target', 'a.rel','iframe.src'));
$config-&gt;set('HTML.SafeIframe', true);
$config-&gt;set('URI.SafeIframeRegexp', '%^http://(www.youtube.com/embed/|player.vimeo.com/video/)%'); </pre><p>
but the iframe is still completely removed, whether I have the iframe in HTML.Allowed... or not</p>

<p>Edited 1 time(s). Last edit at 04/16/2013 11:44PM by amommy.</p>]]></description>
            <dc:creator>amommy</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 25 Apr 2013 17:00:26 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6909,6909#msg-6909</guid>
            <title>Allow HTML, HEAD, STYLE and BODY tags (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6909,6909#msg-6909</link>
            <description><![CDATA[<p>I've read a few posts about this on this forum and on StackOverflow. I want to accept a full HTML document and have HTMLPurifier remove all Javascript (not just &lt;script&gt; tags but onclick/onerror attributes etc).</p>

<p>I know HTMLPurifier isn't planning on supporting full HTML documents until the 5.x series but I thought there might be a hack or modification to get it to allow &lt;html&gt;, &lt;head&gt;, &lt;body&gt; and &lt;style&gt; tags.</p>

<p>I saw a similar question which has this suggested workaround:</p>

<p><code></code></p>

<pre><code>
$config-&gt;set('Core.LexerImpl', 'DirectLex');
$config-&gt;set('HTML.AllowedElements', array('html','head', 'body', 'style', 'div', 'p'));
</code></pre><code></code>

<p>But that didn't solve it for me, HTMLPurifier 4.5 still removes the &lt;html&gt;, &lt;head&gt; and &lt;body&gt; tags.</p>

<p>Can anyone suggest a possible hack or workaround?
Thanks</p>

<p>Edited 1 time(s). Last edit at 04/10/2013 05:57AM by coder49.</p>]]></description>
            <dc:creator>coder49</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 10 Apr 2013 15:03:14 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6905,6905#msg-6905</guid>
            <title>Case switch config (11 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6905,6905#msg-6905</link>
            <description><![CDATA[<p>Hello
I think I have figured out how to use htmlpurifier. I have tested it with several different options using config-&gt;set and it does what I want individually. Now I would like to apply it to different cases after an if. Initially the code was using htmlawed and I want to totally switch to HP
Here is what the lawed code is 
</p>

<pre>
<code>if check security option on
htmlawed $options=array('safe' =&gt; 1,'deny_attribute'=&gt;'style','comment' =&gt; 0,);
 (remove applet, embed, iframe, object, script, onclick, style attribute. CDATA &amp; comments are turned to text) 

Switch
case 0
htmlawed  $options = array( 'elements' =&gt; 'p br', 
'keep_bad' =&gt; 0,
'comment' =&gt; 1,
'safe' =&gt; 1);
 (remove applet, embed, iframe, object, script, onclick, comments and cdata and allow only p and br elements)
then use html2text (convert to text)

case 1
htmlawed $options = array('elements' =&gt; 'a, b, blockquote, br, code, em, font, h1, h2, h3, h4, h5, h6, hr, i, li, ol, p, pre, q, s, small, strike, strong, sub, sup',
'keep_bad' =&gt; 0,
'comment' =&gt; 1,'safe' =&gt; 1);


case 2:
htmlawed $options = array('elements' =&gt; 'a, abbr, acronym, address, b, bdo, big, blockquote, br, caption, center, cite, code, col, colgroup, dd, del, dfn, dir, div, dl, dt, em, embed, fieldset, font, h1, h2, h3, h4, h5, h6, hr, i, iframe, img, ins, label, legend, li, noscript, ol, p, param, pre, q, s, samp, small, span, strike, strong, style, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul',
                  'keep_bad' =&gt; 0,
                  'comment' =&gt; 1,
                  'safe' =&gt; 1);
</code>
</pre>

<p>testing each one individually not as a switch case using htmlpurified works for the most part.
but using it above so far I have to add 
</p>

<pre>
<code>
$config = HTMLPurifier_Config::createDefault();
$config-&gt;set( 'HTML.Allowed', '....');	
$config-&gt;set( ''HTML.ForbiddenElements', '....');
.......more $configs if necessary
$purifier = new HTMLPurifier($config);

</code>
</pre>

<p>each time I want to use hp. How do I just create one instance and <b>maybe</b>, if better use singleton with injection</p>]]></description>
            <dc:creator>amommy</dc:creator>
            <category>Support</category>
            <pubDate>Tue, 16 Apr 2013 15:50:55 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6903,6903#msg-6903</guid>
            <title>encode HTML entities (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6903,6903#msg-6903</link>
            <description><![CDATA[<p>Hello,</p>

<p>Is it possible via HTMLpurifier to encode HTML entities like </p>

<pre>&lt;p&gt; paragraph &lt;/p&gt;</pre><p>, or  </p>

<pre>&lt;b&gt; bold &lt;/b&gt;</pre><p>, etc to not format the code but instead just push the tags without ruining my formatting of the page.</p>

<p>In short just like htmlentites() work in php.</p>

<p>Regards,
tusharvikky</p>]]></description>
            <dc:creator>tusharvikky</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 04 Apr 2013 11:18:01 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6898,6898#msg-6898</guid>
            <title>Running out of memory with &quot;large&quot; CSS queries (3 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6898,6898#msg-6898</link>
            <description><![CDATA[<p>Hi,</p>

<p>I have installed HTMLpurifier as per the simple instructions and as soon as I pass a large CSS style sheet, I get this error in the Apache error log:</p>

<p>PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 129238227 bytes) in /var/www/xxxxx.php on line 122, referer: <a href="http://xxxxx">http://xxxxx</a></p>

<p>I have tried the standalone version and the full version and I get the same result. </p>

<p>I am running a VirtualBox machine(details below) to emulate as closely as possible the production environment where the code will be hosted.</p>

<p>I have uploaded the same set of code to the production environment and I get the same result.</p>

<p>My CSS file is not huge - 2.3kB. Surely no reason to use 128MB of RAM. My best guess is it's getting stuck in some kind of infinite loop.</p>

<p>Any assistance most gratefully received.</p>

<p>--------------------------------------------------------------------
</p>

<pre>
Debian Squeeze
Linux lamp 2.6.32-5-686 #1 SMP Mon Feb 25 01:04:36 UTC 2013 i686
Server: Apache/2.2.16 (Debian)
PHP/5.3.10-1~dotdeb.1
MySQL
Server version: 5.1.66-0+squeeze1
MySQL client version: mysqlnd 5.0.8-dev - 20102224 - $Revision: 321634 $
PHPmyAdmin
Version information: 3.3.7deb7</pre>]]></description>
            <dc:creator>Ferenc Collins</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 03 Apr 2013 16:45:33 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6892,6892#msg-6892</guid>
            <title>Creating a text-only version of submitted HTML (2 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6892,6892#msg-6892</link>
            <description><![CDATA[<p>I'm storing submitted HTML in a MySQL database table. I have attempted to use PHP to strip_tags to remove HTML, but in some cases this causes all of the text to be removed. As I understand this is due to poorly wrapped text and tags.</p>

<p>
Can purifier do this job for me?</p>]]></description>
            <dc:creator>Tyler</dc:creator>
            <category>Support</category>
            <pubDate>Tue, 26 Mar 2013 15:06:29 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6881,6881#msg-6881</guid>
            <title>Does HTML Purifier prevent SQL injection? (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6881,6881#msg-6881</link>
            <description><![CDATA[<p>Hi,</p>

<p>Does HTML Purifier prevent SQL Injection like mysql_real_escape_string ?</p>

<p>Thanks,
Ant</p>]]></description>
            <dc:creator>Ant</dc:creator>
            <category>Support</category>
            <pubDate>Tue, 19 Mar 2013 14:53:40 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6879,6879#msg-6879</guid>
            <title>Replace smart quotes with straight quotes (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6879,6879#msg-6879</link>
            <description><![CDATA[<p>Hi there,
I have a 2 part question:</p>

<p>1. I absolutely HATE Microsoft smart quotes.
Anyway of replacing these (and the single apostrophe) through HTMLPurifier or does this have to be done afterwords using something like str_replace?</p>

<p>
2. RSS Feeds config
I've stored some RSS feed content directly into my database without sanitising or touching it - straight out of the feed and into the db.</p>

<p>Now I want to display one of these feed items. Here's the config I've been using. I want to show images and all the content but I want to make sure it's all SAFE without penalising them too much. Can you please let me know if you think this is OK?</p>

<pre>
$config = HTMLPurifier_Config::createDefault();
$config-&gt;set('Core', 	'EscapeNonASCIICharacters', true);
$config-&gt;set('HTML', 	'Allowed', 	$allowedTags);
$config-&gt;set('HTML', 	'TargetBlank', 	true);
$config-&gt;set('HTML', 	'SafeObject', 	true);
$config-&gt;set('Output', 	'FlashCompat', 	true);
$config-&gt;set('Output', 	'TidyFormat', 	true);
$config-&gt;set('AutoFormat', 'AutoParagraph', false);
$config-&gt;set('AutoFormat', 'RemoveEmpty', true);
$config-&gt;set('AutoFormat', 'RemoveEmpty.RemoveNbsp', true);
$purifier = new HTMLPurifier($config);
</pre>

<p>Thanks!
Richard    :o)</p>]]></description>
            <dc:creator>Richard</dc:creator>
            <category>Support</category>
            <pubDate>Sat, 16 Mar 2013 15:06:32 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6874,6874#msg-6874</guid>
            <title>sanitize url without converting &amp; into &amp;amp; entities (4 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6874,6874#msg-6874</link>
            <description><![CDATA[<p>Should I be sanitizing plain url using html purifier, or is better tool already available within php.</p>

<p>eg. for string like: "<a href="http://www.google.com/search?q=abc&amp;ie=utf">http://www.google.com/search?q=abc&amp;ie=utf</a>"</p>

<p>the &amp; will be converted into</p>

<pre>&amp;amp;</pre>

<p>which is a fair default.</p>

<p>In my use case though, such links are used in href attribute and is passed via json response, do I need to do XSS filter with html purifier, if so how to preserve such url correctly?</p>

<p>PS: not necessarily google.com, but can be any user-input links.</p>]]></description>
            <dc:creator>renni</dc:creator>
            <category>Support</category>
            <pubDate>Fri, 15 Mar 2013 04:27:09 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6869,6869#msg-6869</guid>
            <title>DARTIframe.html issue. (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6869,6869#msg-6869</link>
            <description><![CDATA[<p>Ive got a question, is HTMLpurifier is could be responisble for so calles DARTIframe.html 404 redirection?</p>]]></description>
            <dc:creator>muaidb</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 13 Mar 2013 10:01:42 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6858,6858#msg-6858</guid>
            <title>Purifier not removing script tags? (6 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6858,6858#msg-6858</link>
            <description><![CDATA[<p>Greetings (:</p>

<p>I'm trying to validate user generated HTML that goes into a database and I have found this tool. I have manually inserted a script tag with an alert into a field that I retrieve via php. However, when I process the data with HTML Purifier and then echo it, my browser still displays the hideous alert.</p>

<p>Am I missing some configuration? Will it by default only disable scripts that are malicious?</p>

<p>I have being playing with the config for a bit and I've only  gotten this far:</p>

<pre>
$config = HTMLPurifier_Config::createDefault();
$config-&gt;set('HTML.ForbiddenElements', array('script','style','applet'));
$purifier = new HTMLPurifier($config);

$requisitos_p = $_POST["requisitos"];
$requisitos = $purifier-&gt;purify( $requisitos_p );

echo $requisitos;
</pre>

<p>Any help would be appreciated,</p>

<p>Thanks!</p>]]></description>
            <dc:creator>lunatic</dc:creator>
            <category>Support</category>
            <pubDate>Tue, 12 Mar 2013 07:04:16 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6855,6855#msg-6855</guid>
            <title>How to include the module Core.CollectErrors? (3 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6855,6855#msg-6855</link>
            <description><![CDATA[<p>I include htmlpurifier, it really shows the tags which should appear as a pair. How to include the module Core.CollectErrors to display html markup errors?</p>]]></description>
            <dc:creator>noskovgleb</dc:creator>
            <category>Support</category>
            <pubDate>Mon, 11 Mar 2013 11:38:51 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6851,6851#msg-6851</guid>
            <title>SafeIframeRegexp and wrzuta.pl (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6851,6851#msg-6851</link>
            <description><![CDATA[<p>Ive got problem with regular expression, I want to add wrzuta.pl videos to safeiframe normaly url looks like name.wrzuta.pl/film/ and I have made this regualr expression (\w+).wrzuta.pl/film/ but all Im getting is iframe tag with size attributes.
My SafeIframe looks like</p>

<p>$config-&gt;set('URI.SafeIframeRegexp', '%^http://(www.youtube(?:-nocookie)?.com/embed/|
												
|player.vimeo.com/video/|
															|www.liveleak.com/ll_embed|(\w+).wrzuta.pl/film/)%');</p>

<p>Edited 1 time(s). Last edit at 03/04/2013 05:57AM by muaidb.</p>]]></description>
            <dc:creator>muaidb</dc:creator>
            <category>Support</category>
            <pubDate>Mon, 04 Mar 2013 06:22:19 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6842,6842#msg-6842</guid>
            <title>Max size of iframe (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6842,6842#msg-6842</link>
            <description><![CDATA[<p>Ok ive got a question, is there a way to put max size to iframe into config like in pictures. Im using tinyMCY with purifier.</p>]]></description>
            <dc:creator>muaidb</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 28 Feb 2013 14:53:39 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6831,6831#msg-6831</guid>
            <title>IMG tags become blank (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6831,6831#msg-6831</link>
            <description><![CDATA[<p>Are valid image tags supposed to get wiped out?</p>

<pre>
&lt;img alt="picture" src="<a href="https://domain/images/image.jpg">https://domain/images/image.jpg</a>" style="width: 300px; height: 300px;" /&gt;
</pre>

<p>replaced with</p>

<pre>
&lt;img alt="" src="%5C" /&gt;
</pre>

<p>I'm having a tough time figuring out what the correct behavior of the purifier is!</p>]]></description>
            <dc:creator>mwmurphy</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 20 Feb 2013 14:56:58 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6829,6829#msg-6829</guid>
            <title>Which files are absolutely necessary for htmlpurifier to run? (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6829,6829#msg-6829</link>
            <description><![CDATA[<p>I'm using htmlpurifier on my company's Web site, but when I receive code scans back from our security team, it appears that htmlpurifier is causing some security concerns itself. For example, a number of files in the "smoketests" directory are raising flags for XSS, and other files, such as:</p>

<p>assets/htmlpurifier/maintenance/rename-config.php</p>

<p>assets/htmlpurifier/library/HTMLPurifier/StringHashParser.php</p>

<p>assets/htmlpurifier/maintenance/flush.php</p>

<p>etc.</p>

<p>are raising flags, too. Some of them are path manipulation errors, XSS vulnerabilities, and command inject vulnerabilities.</p>

<p>My question is, which files are absolutely necessary for htmlpurifier to run, and which files can I get rid of?</p>]]></description>
            <dc:creator>mkimitch</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 20 Feb 2013 15:54:28 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6819,6819#msg-6819</guid>
            <title>SESSION variables wiped out when impure HTML detected (12 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6819,6819#msg-6819</link>
            <description><![CDATA[<p>The user submits some HTML via a CKEditor form. Then I want to purify the HTML, so I pass the posted data to a clean_html function. The issue I'm having is that if any malicious code (I used the example from Docs on this website) is found, some of my SESSION variables get wiped out. </p>

<pre>
function clean_html( $string ) {
      require_once( DIR_FS_HTML_PURIFIER . 'library/HTMLPurifier.auto.php' ); 
      $config = HTMLPurifier_Config::createDefault();
      $purifier = new HTMLPurifier( $config );
      $string = $purifier-&gt;purify($string);
      return $string;
}
</pre>

<p>FYI, I also get java console errors related to the name of the malicious javascript function, evil:
Timestamp: 13-02-19 05:43:16 PM
Error: uncaught exception: ReferenceError: evil is not defined</p>

<p>In general, shouldn't the purify function only change the string content without messing with SESSION variables???</p>

<p>I'm thinking perhaps the problem is related to the poorly defined javascript.</p>

<p>If I define the 'evil' javascript function, I get no java console error but the SESSION variables still get broken.</p>

<p>Help!</p>

<p>Thanks,
Marc</p>

<p>Edited 2 time(s). Last edit at 02/19/2013 04:59PM by mwmurphy.</p>]]></description>
            <dc:creator>mwmurphy</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 20 Feb 2013 16:05:44 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6804,6804#msg-6804</guid>
            <title>&lt;&lt; (no replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6804,6804#msg-6804</link>
            <description><![CDATA[<p>Adding &lt;&lt; makes only &lt; it should add  &amp;lt;&amp;lt;</p>]]></description>
            <dc:creator>deep_pl</dc:creator>
            <category>Support</category>
            <pubDate>Fri, 15 Feb 2013 04:29:37 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6779,6779#msg-6779</guid>
            <title>Content Stripped In PRE Tag (2 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6779,6779#msg-6779</link>
            <description><![CDATA[<p>#1 When PRE is used, the content is stripped.</p>

<p>This:
</p>

<pre>
&lt;pre&gt;
 &lt;code&gt;&lt;span class="sql1-reservedword"&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;SELECT
 &lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</pre>

<p>Becomes this:
</p>

<pre>
&lt;pre&gt; &lt;code&gt;&lt;span class="sql1-reservedword"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</pre>

<p>But if I delete the </p>

<pre> tag, I get this:
</pre>

<pre>
 &lt;code&gt;&lt;span class="sql1-reservedword"&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;SELECT
 &lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/code&gt;
</pre>

<p>#2 Is there a way to get it to ignore the pre altogether (or stop removing line breaks and spacing)?</p>]]></description>
            <dc:creator>laurin1</dc:creator>
            <category>Support</category>
            <pubDate>Fri, 01 Feb 2013 12:19:32 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6763,6763#msg-6763</guid>
            <title>Quotes breaks Linkify (5 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6763,6763#msg-6763</link>
            <description><![CDATA[<p>If the following URL is ran through HTMLPurifier, it cuts the link off at the ' character.</p>

<p><a href="http://narod.ru/disk/64890823001.150f69b52b236db449089abdd3f14922/KoreanRandom">http://narod.ru/disk/64890823001.150f69b52b236db449089abdd3f14922/KoreanRandom</a>'s_contoured_2012.12.27.rar.html</p>]]></description>
            <dc:creator>Mark Wade</dc:creator>
            <category>Support</category>
            <pubDate>Sat, 26 Jan 2013 01:49:22 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6761,6761#msg-6761</guid>
            <title>changing name of attributes (7 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6761,6761#msg-6761</link>
            <description><![CDATA[<p>Hey all,</p>

<p>I'm new to HTMLPurifier, is there an easy way to change the "src" in all images into "data-src" to provide better protection for my users?</p>]]></description>
            <dc:creator>Likao</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 24 Jan 2013 05:08:27 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6743,6743#msg-6743</guid>
            <title>TinyMCE advanced and HTMLpurifier (9 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6743,6743#msg-6743</link>
            <description><![CDATA[<p>Hello, on my website <a href="http://bit.ly/XlUd9g">http://bit.ly/XlUd9g</a> I'm trying to use TinyMCE advanced rather than the simple version. When I activate it, the advanced formatting is not showing after saving the ad. I suspect HTMLpurifier is blocking it, but I do not have a clue where to check it. 
Is there a simple solution to it? Could anyone please explain it to me and help?</p>

<p>Thank you!</p>]]></description>
            <dc:creator>cube5</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 09 Jan 2013 16:04:14 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6734,6734#msg-6734</guid>
            <title>Help me understand the proper use of html purifier :) (9 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6734,6734#msg-6734</link>
            <description><![CDATA[<p>I apologize if topic like this has appeared too many times, but I find it is better to ask stupid questions than make stupid mistakes. </p>

<p>I started learning php about an year ago (sporadically), and about a few months ago I decided to create an application which I  use to learn important php concepts and at the end, security.</p>

<p>For the framework I chose codeigniter and for now I feel really comfortable with it. About 2 weeks ago I started learning in more detail about security (from lerning how to program with security in mind, to informing myself about projects such as htmlpurifier) and how can I protect my application from stuff.</p>

<p>While codeigniter got me covered with session encoding, sql injection (via the active record), csrf I kinda didn't understand how to protect my app from xss, because I don't think I understand xss properly and when some other stuff will be less expensive in protecting user form input.</p>

<p>
So for the sake of clarification, I would be grateful if somebody can explain the use of htmlpurifier on an exaple</p>

<p>The example:
I have a simple form which contains the following
- An input field (name) which should only allow alpha (utf-8) symbols (so no stuff like ', etc).
- A textarea, a simple textarea which doesn't allow any of the htlm stuff (strips the tags) and on output it uses preg_replace to make paragraphs out of \n etc. (on edit it just returns it).</p>

<p>
So should I use htmlpurifier for a input field, which only accepts alpha? (uses preg_match("/^([a-z])+$/i", $str)? to filter), or should I use purifier on top of it?</p>

<p>Should I use purifier on an textarea which uses strip_tags(), or should I use purifier (and how should I configure it to prorerlly strip tags?). </p>

<p>I guess that on form element such as dropdown and radio button using a purifier makes no sense?</p>

<p>I read in the documentation (at least the parts that I could understand to be honest, i am lacking in knowledge) that in order to speed up html purifier, one should purify on input, and not on output? So the question is when should I purify on output? </p>

<p>Other than on form submision should I purify somewhere else too?</p>

<p>Can someone point out what are the classical mistakes that people do when using htmlpurifier, and some common knolwedge guidelines about it?</p>]]></description>
            <dc:creator>Dingo2</dc:creator>
            <category>Support</category>
            <pubDate>Mon, 15 Apr 2013 07:01:09 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6731,6731#msg-6731</guid>
            <title>Cannot retrieve raw version without specifying %HTML.DefinitionID (2 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6731,6731#msg-6731</link>
            <description><![CDATA[<p>Hello,</p>

<p>I am trying to work with the sfXSSSafePlugin for symfony that is based on HtmlPurifier 4.3</p>

<p>When I execute $config-&gt;maybeGetRawHTMLDefinition() I get the following error,</p>

<p>"Cannot retrieve raw version without specifying <a href="/live/configdoc/plain.html#HTML.DefinitionID">%HTML.DefinitionID</a>"</p>

<p>This is because the content in $config is the default from the Schema.ser - It does not contain <a href="/live/configdoc/plain.html#type.definitionID">%type.definitionID</a>.</p>

<p>If I try to avoid executing that statement, I get the following error</p>

<p>"Cannot use non-block element as block wrapper"</p>

<p>Please help me as it is very urgent.</p>

<p>Thank you</p>

<p>Edited 1 time(s). Last edit at 12/20/2012 06:16AM by Hope.</p>]]></description>
            <dc:creator>Hope</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 20 Dec 2012 06:33:15 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6724,6724#msg-6724</guid>
            <title>Allowing display:block on img tags (4 replies)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6724,6724#msg-6724</link>
            <description><![CDATA[<p>Hi All,</p>

<p>Im obviously doing it wrong somewhere but i can't find much information about it from the usual sources.</p>

<p><code>
include('HTMLPurifier.standalone.php');

$config = HTMLPurifier_Config::createDefault();

$config-&gt;set('CSS.AllowTricky', true);
</code></p>

<p>As i understand it this config should allow display:block on img tags?</p>

<p>Edited 2 time(s). Last edit at 12/19/2012 10:14AM by cosmicsafari.</p>]]></description>
            <dc:creator>cosmicsafari</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 19 Dec 2012 10:44:13 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6716,6716#msg-6716</guid>
            <title>Improve signatures on this forum (1 reply)</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6716,6716#msg-6716</link>
            <description><![CDATA[<p>Hey there.</p>

<p>Signature system on this forum looks kinda awkward.</p>

<p>1. It displayed strange:</p>

<p>a). It's not visually delimited from the message.</p>

<p>b). It doesn't respect newlines. My signature right now is displayed in a single line.</p>

<p>2. Looks like it cached or copied to the message itself. When i update the signature in my profile it doesn't update on a post page.</p>

<p>Slava Fomin II</p>

<p>Let's make this World a Better place!</p>]]></description>
            <dc:creator>s.fomin</dc:creator>
            <category>Support</category>
            <pubDate>Tue, 18 Dec 2012 02:23:43 -0500</pubDate>
        </item>
    </channel>
</rss>
