|
New configurable option - disable CSS filters October 02, 2010 01:17PM |
Registered: 2 years ago Posts: 5 |
Hello, would it be possible to create a new configurable option, something like:
CSS.disable = boolean
I need that HTMLPurifier doesn't touch style property of element and keeps it as it is. The only solution I have found is to customize file HTMLPurifier/AttrDef/CSS.php as follows:
class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
{
public function validate($css, $config, $context) {
return $css;
.........
It would be much better if I wouldn't have to make this custom change and rather use configurable option.
|
Re: New configurable option - disable CSS filters October 02, 2010 05:38PM |
Admin Registered: 6 years ago Posts: 2,632 |
|
Re: New configurable option - disable CSS filters October 03, 2010 12:22AM |
Registered: 2 years ago Posts: 5 |
|
Re: New configurable option - disable CSS filters October 03, 2010 04:59AM |
Admin Registered: 6 years ago Posts: 2,632 |
|
Re: New configurable option - disable CSS filters October 03, 2010 05:11AM |
Registered: 2 years ago Posts: 5 |
Tidy doesn't work very well for my case, it is not 100% correct, sometimes it doesn't produce valid code.
HTMLPurifier is good in this, but it touches my style attributes. And I don't get why 'position:absolute' is dangerous and needs to be filtered out ?
Please think it over and try including this configurable option to not use CSS filters at all if desired, it would make my life and maybe others much easier.
|
Re: New configurable option - disable CSS filters October 03, 2010 05:23AM |
Admin Registered: 6 years ago Posts: 2,632 |
Imagine if you had some "Login" link on your page. A user would expect to be able to click on it and then type their password. If you allow absolute CSS positioning, someone could style an alternate login link and then have it render on top of the real one. Instant phishing.
It sounds like you might want a CSS.Trusted though, akin to %HTML.Trusted
|
Re: New configurable option - disable CSS filters October 03, 2010 05:37AM |
Registered: 2 years ago Posts: 5 |
|
Re: New configurable option - disable CSS filters October 03, 2010 05:57AM |
Admin Registered: 6 years ago Posts: 2,632 |
|
Re: New configurable option - disable CSS filters October 03, 2010 06:05AM |
Registered: 2 years ago Posts: 5 |
|
Re: New configurable option - disable CSS filters November 12, 2010 01:45PM |
Admin Registered: 6 years ago Posts: 2,632 |