Filter system should be rewrited, last changes to CVS version made filter system totaly unusable. My propositions:
1. Backout last filter changes (so filters are called only on submission)
2. Content should be filtered only when !user_access("administer nodes")

First point is clear, and something about second point.
Lets have following situation, HTML filters enabled, allowed tags h1 h2 pre and now some administrator would like to add node with form element. To do that he must turn off filters (and then some user could post his "malicious" tags) for some time, second option is to add form tags to allowed tags (also bad idea). With filters used when !user_access("administer nodes") administrator could post anything and input from normal user would be filtered without any problems. I can provide patch to this.

Comments

Steven’s picture

I have carried this over onto the mailinglists because the issue is a lot more complex than just deciding to filter before or after submission.
A major rehaul of the filter system is required.

Read the mail here

bkessels’s picture

Title: Filter system » Re: [drupal-devel] bug #1812 : Filter system

>2. Content should be filtered only when !user_access("administer
>nodes")

This seems not a good option to me. Some filters (more to come i hope :) ) provide extra functionality.
When !user_access("administer nodes") is used, Glossary, urlfilter and much more will not work for administrators.
That would mean an admin has to have two accounts: one to administer and one to post. Seems very unhandy to me!

An option would be to provide access based filtering. So for each filter needs to be set to wich user roles it applies. This is, IMHO, way too much work.

Ber

Check www.mediarevolution.org voor mijn nieuwste site.
We zijn nog hard aan knutselen, maar opmerkingen en tips
zijn van harte welkom.

GmbH’s picture

Yes, I forgot about other filters like Glossary (mayby because I don't use them). So mayby small modification:

common.inc:

function filter($text, $when) {
...
module_invoke($name, "filter", $text, $when);
...
}

in module:

function filter($text, $when="onsubmit") {
switch ($when) {
case "onsubmit":
...
case "onview":
...
}
}

Then add some priviledges checking to "onsubmit" Only local images are allowed. ink" alt="Eye-w
ink" />

Glossary and URLFilter should be then in "onview" category.

al’s picture

Title: Re: [drupal-devel] bug #1812 : Filter system » Filter system
moshe weitzman’s picture

Component: Node system » base system
Category: bug » feature
jonbob’s picture

Rewritten in HEAD.

Anonymous’s picture