URLs in aggregator have double encoded '&' sign in URLs. This behaviour started with upgrade to Drupal 4.6.4. Even the fix for 4.6.4 ( http://drupal.org/node/39566 ) didn't help. I think the problem is that the links have '&' encoded as entity in DB. When the link is shown, the entity is encoded once again resulting in double encoded entities.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | aggregator.module.xss01.patch | 492 bytes | frjo |
Comments
Comment #1
frjo commentedI can confirm this bug.
URL:s in aggregator end up like this
when they should look like this. (This is also how they now are saved in the db.)
If I remove the calls to check_url() for $item->link in the functions theme_aggregator_block_item, theme_aggregator_summary_item and theme_aggregator_page_item the links comes out correct.
This make some sense I thinks because the feed items has already been "cleaned" in the aggregator_parse_feed function by filter_xss().
Is this a correct fix?
Comment #2
chx commentedno. The correct way is _not_ to filter_xss $item['link'] but only check_url it. Why? Because the link is not HTML but a value of HREF attribute and therefore the filter_xss is not appropriate here. Someone would care to submit a patch? :)
Comment #3
frjo commentedI have attached a patch that does this
It fix the problem on my site with no ill effects that I can see.
Comment #4
chx commentedfrom a security standpoint of view, I am OK with this change, GUID is only used to replace link and link is check_url'd everywhere.
From an aggregator point of view , i have no idea.
Comment #5
dries commentedCommitted to DRUPAL-4-5 and DRUPAl-4-6. For HEAD, I'd like to move the filtering from 'on input' to 'on output'.
Comment #6
moshe weitzman commentedComment #7
(not verified) commented