<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>style attirbute completely removed??</title>
        <description>hi..

i am using a RTE EDITOR ( free rich text editor ) i am passing the html generated by it through the HTMLpurifier. 

but the output of HTMLpurifier is everything except the style attributes in my HTML.
why so?
then the purpose of using an rte editor is defeated.
can some one tell me. will there be any xss using style attribute also?
why is it removed by HTMLpurifier ?
i want to allow that attribute what should i do?

example:
rte generated html:




&amp;lt;h1 style=&quot;font-family: tahoma; color: rgb(255, 0, 0); font-weight: bold; font-style: italic; text-decoration: underline line-through; text-align: center;&quot;&amp;gt;&amp;lt;font size=&quot;7&quot;&amp;gt;adf&amp;lt;/font&amp;gt;&amp;lt;/h1&amp;gt;


the output of HTMLpurifier is




&amp;lt;h1&amp;gt;&amp;lt;font size=&quot;7&quot;&amp;gt;adf&amp;lt;/font&amp;gt;&amp;lt;/h1&amp;gt;

</description>
        <link>http://htmlpurifier.org/phorum/read.php?3,1126,1126#msg-1126</link>
        <lastBuildDate>Sat, 18 May 2013 06:41:55 -0400</lastBuildDate>
        <generator>Phorum 5.2.18</generator>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,1126,1130#msg-1130</guid>
            <title>Re: style attirbute completely removed??</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,1126,1130#msg-1130</link>
            <description><![CDATA[<p><a href="http://docs.php.net/manual/en/security.magicquotes.disabling.php">Magic quotes</a>.</p>]]></description>
            <dc:creator>Ambush Commander</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 26 Dec 2007 10:24:46 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,1126,1129#msg-1129</guid>
            <title>Re: style attirbute completely removed??</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,1126,1129#msg-1129</link>
            <description><![CDATA[<p>this is my allowed attributes.
i urgently need to fix up this.
i cant read the entire documentation.
what i did is.
just simply downloaded and extracted the zip file.
and using </p>

<pre>
&lt;?php
    require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
    
    $purifier = new HTMLPurifier();
    $clean_html = $purifier-&gt;purify($dirty_html);
?&gt;
</pre>

<p>this part of code to parse the html.
then why is style atttribute not working for me.
kindly suggest. asap.</p>]]></description>
            <dc:creator>kishorekumar</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 26 Dec 2007 00:25:29 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,1126,1128#msg-1128</guid>
            <title>Re: style attirbute completely removed??</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,1126,1128#msg-1128</link>
            <description><![CDATA[<pre>

HTMLPurifier_ConfigSchema::define(
    'HTML', 'AllowedAttributes', null, 'lookup/null', '
&lt;p&gt;
    If HTML Purifier\'s attribute set is unsatisfactory, overload it! 
    The syntax is "tag.attr" or "*.attr" for the global attributes 
    (style, id, class, dir, lang, xml:lang).
&lt;/p&gt;
&lt;p&gt;
    &lt;strong&gt;Warning:&lt;/strong&gt; If another directive conflicts with the 
    elements here, &lt;em&gt;that&lt;/em&gt; directive will win and override. For 
    example, <a href="/live/configdoc/plain.html#HTML.EnableAttrID">%HTML.EnableAttrID</a> will take precedence over *.id in this 
    directive.  You must set that directive to true before you can use 
    IDs at all. This directive has been available since 1.3.0.
&lt;/p&gt;
');
</pre>]]></description>
            <dc:creator>KishroeKumar</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 26 Dec 2007 00:22:42 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,1126,1127#msg-1127</guid>
            <title>Re: style attirbute completely removed??</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,1126,1127#msg-1127</link>
            <description><![CDATA[<p>As you can see <a href="http://htmlpurifier.org/demo.php?filter%5BCore.CollectErrors%5D=0&amp;filter%5BNull_URI.Munge%5D=1&amp;filter%5BURI.DisableExternalResources%5D=0&amp;filter%5BHTML.TidyLevel%5D=medium&amp;filter%5BHTML.Doctype%5D=&amp;filter%5BNull_HTML.Allowed%5D=1&amp;filter%5BAutoFormat.AutoParagraph%5D=0&amp;filter%5BAutoFormat.Linkify%5D=0&amp;html=%3Ch1+style%3D%22font-family%3A+tahoma%3B+color%3A+rgb%28255%2C+0%2C+0%29%3B+font-weight%3A+bold%3B+font-style%3A+italic%3B+text-decoration%3A+underline+line-through%3B+text-align%3A+center%3B%22%3E%3Cfont+size%3D%227%22%3Eadf%3C%2Ffont%3E%3C%2Fh1%3E%0D%0A&amp;submit=Submit">here</a>, HTML Purifier by default preserves style attributes. Two things:</p>

<ol><li>Make sure magic quotes is off</li>
<li>Make sure you've allowed the style attribute if you've restricted allowed tags/attributes</li></ol>]]></description>
            <dc:creator>Ambush Commander</dc:creator>
            <category>Support</category>
            <pubDate>Mon, 24 Dec 2007 20:46:41 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,1126,1126#msg-1126</guid>
            <title>style attirbute completely removed??</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,1126,1126#msg-1126</link>
            <description><![CDATA[<p>hi..</p>

<p>i am using a RTE EDITOR ( <a href="http://freerichtexteditor.com/page/3.htm">free rich text editor</a> ) i am passing the html generated by it through the HTMLpurifier. </p>

<p>but the output of HTMLpurifier is everything except the style attributes in my HTML.
why so?
then the purpose of using an rte editor is defeated.
can some one tell me. will there be any xss using style attribute also?
why is it removed by HTMLpurifier ?
i want to allow that attribute what should i do?</p>

<p>example:
rte generated html:
</p>

<pre>

&lt;h1 style="font-family: tahoma; color: rgb(255, 0, 0); font-weight: bold; font-style: italic; text-decoration: underline line-through; text-align: center;"&gt;&lt;font size="7"&gt;adf&lt;/font&gt;&lt;/h1&gt;

</pre><p>
the output of HTMLpurifier is
</p>

<pre>

&lt;h1&gt;&lt;font size="7"&gt;adf&lt;/font&gt;&lt;/h1&gt;

</pre>]]></description>
            <dc:creator>KishoreKumar</dc:creator>
            <category>Support</category>
            <pubDate>Mon, 24 Dec 2007 00:39:50 -0500</pubDate>
        </item>
    </channel>
</rss>
