Closed (duplicate)
Project:
External Links
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2018 at 10:41 UTC
Updated:
1 May 2018 at 00:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
elachlan commentedJust to be a bit more specific. Do ALL links stop getting the extlink icon? Also do you have any errors in the console?
Comment #3
camerongreen commentedI just installed this module, seems only some links work, others don't.
I've tried some tests, there seems to be a pattern.
It never seems to work on domains like example.org.au, example.com.au (seems to be baised against Australian domains :).
Also some other domains it seems to fail on http://www.aussiepigs.com/lucent, but http://www.example.com/lucent will work fine (More evidence of anti australianism!).
Just to finally prove this clear discrimination:
www.auspigs.com - doesn't work
www.usapigs.com - does work!
Clearly some sort anti-aussie conspiracy here.
Comment #4
elachlan commentedCan you post the html in a code block here? Also what are your settings and did you receive errors in your console?
Comment #5
ecvandenberg commentedI now see a pattern. Hyperlinks to the extensions .com .org or .de work fine. But the extension .nl does not. A hyperlink to www.domain.com gets the icon. A hyperlink to www.domain.nl does not.
When I look at the HTML source in Firefox it looks like:
And when I look at it with Firefox inspector it looks like:
Comment #6
elachlan commentedAre any of you using any css exclude, regex exclude, or "Exclude links with the same primary domain."?
Comment #7
camerongreen commentedI just installed the module and maybe turned on open links in a new window, nothing else. Exclude links with the same primary domain is checked, but I don't recall checking it, think it was turned on by default.
Hmm, so I think you could be on to something though, I just turned it off and all the links work. So something askew there.
Comment #8
elachlan commentedCan you apply this patch and see if it fixes the problem?
Comment #9
ecvandenberg commentedYes it does! And switching on and off the function "Exclude links with the same primary domain." works also.
Thanks for your quick response.
Comment #11
elachlan commentedThanks. I'll do a release soon.
Comment #12
rooby commentedAs I originally reported in #2961407: Regressions in 1.19?, I think version 1.20 still isn't working correctly.
One of my main problems was that I was testing on a temporary domain where the site is actually on a sub-domain and I was getting confusing results.
That aside though, the regex looks strange to me.
It would be useful to have some comments in the code stating what the different blocks of regex are trying to match, eg. domain name, port, file extension, etc.
It would make it much easier for a new developer to come in and do work on the code.
The current version has this:
So if my page is at website.gov.au/some/path then I get this
So host ends up being gov.au and the subdomain is empty, which is wrong.
If my page is at www.website.gov.au/some/path then I get this:
So host ends up being gov.au and the subdomain is empty, which is wrong.
If you go back to 1.18 you have this:
So if my page is at website.gov.au/some/path then I get this
So host ends up being website.gov.au and the subdomain ends up being empty, which is correct.
If my page is at www.website.gov.au/some/path then I get this:
So host ends up being website.gov.au and the subdomain ends up being www, which is correct.
Comment #13
rooby commentedComment #14
elachlan commentedThanks for your input. Please see the discussion at #2914838: (Sub-)domain detection not reliable..
Comment #15
rooby commentedPS...
The issue where this bug was introduced was #2679977: New top level domains and pattern matching
The commit was: https://cgit.drupalcode.org/extlink/commit/?id=d6ab635
Will need to do a bit more work on the regex to fix both issues I assume.
If that's not trivial, the quick temporary fix would be to revert that commit, since it is worse with that commit for most (maybe all?) production use cases.