When image attach images are included in RSS feeds the URLs are not absolute. This causes broken links when feeds are viewed on remote sites.

I was able to resolve by making this change:

Line 394 in image_attach.module:

$output .= l(image_display($image, $img_size), "node/$node->nid", array('html' => TRUE, ));

I added the 'absolute' attribute to the $options array changing it to:

$output .= l(image_display($image, $img_size), "node/$node->nid", array('html' => TRUE, 'absolute' => TRUE));

From a quick look at the code, I guess this means that all image attach urls in nodes will be absolute, but I think this is less important than having broken links on remote sites. If I've missed an alternative, please comment.

I'm not set up to generate patches, so please consider turning this into a patch for inclusion.

Regards,
Sverre :-)

Comments

joachim’s picture

Does an RSS node go through $op 'view' as well as $op 'rss item' in http://api.drupal.org/api/function/hook_nodeapi/6?
Is there anything in $node we can check in the theming function to tell whether we're in RSS?

sun’s picture

Status: Active » Closed (duplicate)

Marking as duplicate of #172819: Include image in Drupal's RSS Feed. Please search for existing issues before submitting a new one. You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.

However, thanks for taking the time to report this issue.