Download & Extend

Relative links in feed items don't get resolved correctly

Project:Leech
Version:5.x-1.x-dev
Component:leech_news
Category:bug report
Priority:normal
Assigned:Aron Novak
Status:closed (fixed)

Issue Summary

Hi,

leech seems to suffer from the exact same problem as the planet module (relative links are interpreted incorrectly).
Read more about the problem and fix here:

http://drupal.org/node/164597

kind regards,
-- Steven

Comments

#1

Title:problems with relative links» Relative links in feed items don't get resolved correctly
Version:5.x-1.9» 5.x-1.x-dev

More accurate title.

Thanks Steven for your bug report. We are tight on schedule and I can't roll a patch for this bug at the moment.

If somebody wants to step up here, feel welcome to do so.

Alex

#2

Status:active» needs review

I have read http://drupal.org/node/164597 , and have the same problem.

I may be very wrong, but modified the leech_news_parser.inc, seems well.

  // Make relative URLs to be global
  //$base = '';
  //if ($item->link) {
  //  $q = strpos($item->link, '?');
  //  if ($q > 0) {
  //    $q = strrpos(substr($item->link, 0, $q), '/');
  //  }
  //  else {
  //    $q = strrpos($item->link, '/');
  //  }
  //  $base = substr($item->link, 0, $q);
  //}
  $parsed = parse_url($item->link);
  $base = $parsed['scheme'] ."://". $parsed['host'];
  $item->body = parse_relative_urls($item->body, $base);
  $item->teaser = parse_relative_urls($item->teaser, $base);

  return $item;

#3

Thanks Hipfox, your solution seemed to be good, i applied the patch. Btw. in addition the regexp in parse_relative_urls() was not perfect too, i improved that function also. Please tell me if you experience relative-links problems with the CVS version or not.

#4

Assigned to:Anonymous» Aron Novak
Status:needs review» fixed

I tested with various feeds, it works as expected. Please reopen the bug if you find that the bug is still exist at your environment. If you reopen it, please supply an exact list of feeds which are problematic.

#5

Status:fixed» closed (fixed)
nobody click here