I have my aggregator plugin for Drupal (which this module uses) set to filter out lots of HTML including Image tags. It does this just fine when viewed directly.

When I view an aggregated feed through my MyPage site, it doesn’t strip the HTML out of the feed, causing all sorts of images to be loaded into my MyPage, which I don’t want.

As near as I can tell (and I don’t know enough to be able to tell much) MyPage doesn’t use the filter at all. Can this be changed?

I'm using the 5.1 Drupal and the 1.8 Mysite.

CommentFileSizeAuthor
#7 feed_4.png101.89 KBagentrickard
#4 blackjaw.png173.95 KBagentrickard

Comments

agentrickard’s picture

When the teaser elements for a MySite aggregator feed are loaded, they run through aggregator_filter_xss(). http://api.drupal.org/api/5/function/aggregator_filter_xss.

Some previous versions did not do this, so you may need to upgrade to the 5.x.1.8 tarball.

See lines 103 of aggregator.inc and 112 of feed.inc.

$items[$i]['teaser'] = aggregator_filter_xss($obj->description);

If you'd like to use a different filter, then you could change that line in your installation.

agentrickard’s picture

Status: Active » Closed (fixed)
blackjaw@pseudolife.com’s picture

Status: Closed (fixed) » Active

I am running the Feb 12 2007 MySite (1.8), and the 5.1 Drupal.

I just checked and the Mysite inc files call "aggregator_filter_xss()" and my aggregator.module contains "aggregator_filter_xss()" with the correct filter.

I have no idea why my mysite page loads with pictures, but here it is:
http://www.pseudolife.com/?q=mysite/2

...and here is the Feed Category being run direct (not through mysite), and it is being filtered:
http://www.pseudolife.com/?q=aggregator/categories/7

Any idea why it doesn't seem to be filtering the Feed Category on Mysite?

I am running the following modules:
Audio, aggregator, Blog, color, drupal, forum, help, menu, ping, profile, search, statistics, taxonomy, tracker, upload, Image, Spamspan, bloginfo, readmoretweak, freelinking, invite, janode, mysite, paging, panels, poormanscron, private, textimage, tinyMCE, Weather, Wishlist, chaptcha, tagadelic, video, and views.

agentrickard’s picture

StatusFileSize
new173.95 KB

As an anonymous visitor to your site, I don't sse images in either of the links you refer to.

Attached is what I view at http://www.pseudolife.com/?q=mysite/2

So perhaps it's a setting that affect how you see the site? I suspect that is external to MySite. I do know that aggregator_filter_xss() is responsive to settings here: admin/content/aggregator/settings.

Can you give me a feed URL that shows images on your site?

blackjaw@pseudolife.com’s picture

You happened to stop by after one of the feeds without images (or any teaser at all) spammed their RSS feed...

I've setup a feed category that contains posts that almost always have images now, so there is a better chance at seeing the problem live:
http://www.pseudolife.com/?q=mysite/2

And here is the same feed group when not seen through mysite:
http://www.pseudolife.com/?q=aggregator/categories/8

As you can (hopefully this time) see, the mysite view of the same feeds isn't being filtered while the direct look at the feeds is being filtered. To me, this implies that the filter is on and is working for feeds, but that some as of yet unknown issue is stopping it from being used on the Mysite page.

Thanks for any help you can give.

agentrickard’s picture

Priority: Minor » Normal

No, that's a pretty clear example. I'll test it locally and see what I come up with.

agentrickard’s picture

StatusFileSize
new101.89 KB

Can't replicate the error.

Here's what I get in MySite 5.x.1.9 and Drupal 5.1 with only Core modules and MySite enabled.

agentrickard’s picture

Let me rephrase that: I couldn't replicate the error with feeds added via the Aggregator module. Testing now with feeds added directly through MySite.

agentrickard’s picture

It's getting filtered properly in both cases against a default 5.1 install of Drupal.

Make sure that <img> isn't in your list of allowed tags under admin/content/aggregator/settings. MySite respects those settings.

Also, check line 2 of /mysite/plugins/types/aggregator.inc and /mysite/plugins/types/feed.inc. They will look like so:

// $Id: aggregator.inc,v 1.1.2.2.6.3 2006/12/19 21:35:13 agentken Exp $

The version string for aggregator.inc should be 1.1.2.2.6.3. For feed.inc it should be 1.1.2.2.4.5. But I think we already ruled this out, since the aggregator_filter_xss() line is present.

blackjaw@pseudolife.com’s picture

I'm on lunch at work right now, but latter I'll setup a test site on my multi-site drupal setup (the one currently running this error) and do a clean version of the site with just the core mods and mysite active later. That should help us see if it's a problem with some other active mod or some strange setting I've messed with... which I think it likely given this makes no sense and isn't reproducible.

My allowed tags are: <a> <b> <br> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul>

I'll check the version code against what you posted latter as well.

Thank you for the help.

agentrickard’s picture

Version: 5.x-1.8 » 5.x-1.9
Assigned: Unassigned » agentrickard

No need for thanks. If this is a MySite bug, it's fairly serious. So we need to figure out the cause and get it corrected. I'll test whatever I need to. But my test suggests that MySite is not the cause.

I'm going to upgrade the Version on this task to 5.x.1.9, since we should test against the newest release.

agentrickard’s picture

Status: Active » Postponed (maintainer needs more info)

Changing status.

blackjaw@pseudolife.com’s picture

Status: Postponed (maintainer needs more info) » Fixed

I setup a beta site and only activated the minimum mods needed to test this bug. I setup the same feeds that I was having trouble with on the live site and the DID show images, even letting in an embedded YouTube video.

I then updated the beta site (alone) to 1.9 from 1.8 mysite, and this immediately fixed everything.
http://beta.pseudolife.com/?q=mysite/1/view

I have now updated my live real site to 1.9, and that fixed my own mysite:
http://www.pseudolife.com/?q=mysite/2/view

I've had this problem since 1.6, when I first installed mysite, up through the 1.8 mysite. Did you change that part of the code at all in 1.9 upgrades or otherwise do anything that would have fixed a bug you didn't know existed?

agentrickard’s picture

The x.1.7 and above upgrades were specifically released to address this issue.

This was a known bug in versions prior to x.1.5, where filtering wasn't applied at all to feeds. There was no official x.1.6 release. The problem should have been fixed in x.1.7 x.1.8 and x.1.9 (.7 and .8 had other bugs).

It is also possible that the MySite cache kept the page showing in error after you upgraded. The MySite cache will cache the entire output of the MySite page, so if it was displaying images when the page view was cached, they would persist until the cache clears.

agentrickard’s picture

I misspoke. This was a known issue _in_ version x.1.5 and previous.

agentrickard’s picture

Version: 5.x-1.9 » 5.x-1.5
Status: Fixed » Closed (fixed)

I'm going to refile this as against x.1.5 and close it, since it is fixed in the current release.