|
KishoreKumar
style attirbute completely removed??December 24, 2007 12:39AM |
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:
<h1 style="font-family: tahoma; color: rgb(255, 0, 0); font-weight: bold; font-style: italic; text-decoration: underline line-through; text-align: center;"><font size="7">adf</font></h1>
the output of HTMLpurifier is
<h1><font size="7">adf</font></h1>
|
Re: style attirbute completely removed?? December 24, 2007 08:46PM |
Admin Registered: 6 years ago Posts: 2,632 |
|
KishroeKumar
Re: style attirbute completely removed??December 26, 2007 12:22AM |
HTMLPurifier_ConfigSchema::define(
'HTML', 'AllowedAttributes', null, 'lookup/null', '
<p>
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).
</p>
<p>
<strong>Warning:</strong> If another directive conflicts with the
elements here, <em>that</em> directive will win and override. For
example, %HTML.EnableAttrID 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.
</p>
');
|
kishorekumar
Re: style attirbute completely removed??December 26, 2007 12:25AM |
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
<?php
require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
$purifier = new HTMLPurifier();
$clean_html = $purifier->purify($dirty_html);
?>
this part of code to parse the html. then why is style atttribute not working for me. kindly suggest. asap.
|
Re: style attirbute completely removed?? December 26, 2007 10:24AM |
Admin Registered: 6 years ago Posts: 2,632 |