The code that tests if a link refers to u current host's subdomains works wrong. For example, is current host is example.com, it would treat http://one.moreexample.com as an internal link. I still don't know the right method of generating .patch files (SORRY!!!), so I'm just writing the fix here:

  // Determine what subdomains are considered internal.
  if (Drupal.settings.extlink.extSubdomains) {
--    var subdomains = "([^/]*)?";
++    var subdomains = "([^/]*\\.)?";
  }
  else if (subdomain == 'www.' || subdomain == '') {
--    var subdomains = "(www\.)?";
++    var subdomains = "(www\\.)?";
  }
  else {
--    var subdomains = subdomain.replace(".", "\.");
++    var subdomains = subdomain.replace(".", "\\.");
  }

I've tested it and it works fine on all my sites (using Drupal 6.14/6.15).

CommentFileSizeAuthor
#1 extlink_subfix.patch821 bytesquicksketch

Comments

quicksketch’s picture

Status: Needs review » Fixed
StatusFileSize
new821 bytes

Sweet, thanks it took me 5 reads to figure out what the problem was that you were describing. I think I assumed a typo when you used http://one.moreexample.com as your example. After reproducing the problem correctly I found that your "patch" does indeed fix the problem. I've committed it to the Drupal 6 branch. Thanks!

marrch_caat’s picture

Wonderful! I'm always glad to help a good project like this one.

By the way, I'm using a feature-adding patch to the module that adds one more link processing feature: it allows specifing a title attribute for all links to the root page (site name by default). For some strange reason Drupal doesn't add the title attribute even to breadcrumbs "Home" link, so I had to do something with that - 'cause it's good for SEO as well as for usability.
I see that the main goal of ExtLinks module is a bit different, but I decided that there should better be one script processing all links than several ones, so I've patched ExtLinks. If you're interested in the feature, I'll provide you with the patch (as soon as I find out, how should that .patch files be generated!!).

Sincerely yours, Alex the Marrch Ca'at.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.