Welcome! » Log In » Create A New Profile

Configuration on Drupal 5.x?

Posted by Tom Geller 
Tom Geller
Configuration on Drupal 5.x?
February 04, 2008 09:16PM

Hey, folks! I downloaded the htmlpurifier module to my Drupal 5.7 installation, then started it by using the Administer > Modules page. Then... I didn't know what to do. I was still getting non-compliant characters in an RSS feed, and didn't see any controls in the Administer pages... what am I missing?

The page in question is at http://www.savemyhomebook.com; see the right-hand column. (The New York Times feed is the problem, under "Foreclosure news").

Thanks!

Re: Configuration on Drupal 5.x?
February 04, 2008 09:24PM

What module are you using to scrape this RSS feed?

Tom Geller
Re: Configuration on Drupal 5.x?
February 07, 2008 09:07PM

I'm using Aggregator.

Re: Configuration on Drupal 5.x?
February 08, 2008 01:34PM

I'm inclined to say this is a bug in Aggregator. HTML Purifier only handles content filters, and I don't think Aggregator uses those. You might be able to use HTMLPurifier_EntityParser to fix the problem, though.

Tom Geller
Re: Configuration on Drupal 5.x?
February 08, 2008 04:00PM

Thanks for the tip. How would I implement HTMLPurifier_EntityParser in Drupal 5.x? (I'm not a programmer.)

Thanks again,

--Tom

Re: Configuration on Drupal 5.x?
February 11, 2008 09:46PM

That might be a little difficult, if you don't know how to program PHP. Why don't you file a bug on Aggregator's tracker?

Re: Configuration on Drupal 5.x?
February 12, 2008 03:25AM

Indeed a problem in Drupal's core Aggregator module. More complaints <a href="http://drupal.org/node/61456">on drupal.org</a>.

Drupal's architecture needs to be changed to allow admins complete control over filtering of both input (what is stored in the database) and output (the final, displayed HTML). Further, this filtering should be customizable as per every content type (newsfeed, user comment, and so on). E.g., machine-generated newsfeed titles (database stored) can be filtered for XSS, appropriate HTML tags, etc., during the input stage to avoid the overhead of similar filtering everytime the title is output as web page content.

Also, appropriate code/principles should be used from better (than Drupal's Filter module) filtering scripts like <a href="http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/index.php">htmLawed</a> and <a href="http://www.htmlpurifier.org">HTMLPurifier</a>. Though the mentioned scripts can be used in plugged-in modules, they then either cannot have certain functionalities (like, to address the newsfeed-entity issue), or re-do some actions that Drupal's core does anyway (increasing the processing time).

Re: Configuration on Drupal 5.x?
February 12, 2008 01:41PM

Patnaik, thank you for your research.

I don't think it's so much an architectural issue; more of an "aggregator module doesn't let you use custom filter formats", which is aggregator's issue, not Drupal core's.

Tom Geller
Re: Configuration on Drupal 5.x?
February 12, 2008 02:39PM

Thanks all around for the information. But I'm still stuck: What would you recommend I use for a (properly formatted) newsfeed on my Drupal 5.7 site?

Re: Configuration on Drupal 5.x?
February 12, 2008 03:46PM

If there's an alternative to aggregator, it might do things correctly. Otherwise, you're out of luck. Nicely ask one of the devs to fix the problem, I suppose ;-)

Tom Geller
Re: Configuration on Drupal 5.x?
February 12, 2008 05:54PM

Thanks again. If anyone knows of an alternative that works, I'm all ears. :)

Re: Configuration on Drupal 5.x?
February 12, 2008 07:21PM

Looks like the issue is because of <code>check_plain</code> function being used on the feed item titles. You can try editing the file <code>drupal/modules/aggregator/aggregator.module</code> in a good plain-text/code editor.

Lines 289, 1179, 1267, 1352, 1367 and 1394 of the file (version timed 1-10-08 22:14) have code like: <pre><![CDATA[ ... check_plain($item->title) ... ]]></pre>

Try replacing all those six <code>check_plain</code> occurrences with <code>aggregator_filter_xss</code>.

Sorry, you do not have permission to post/reply in this forum.