Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
When inside a modalframe I need to open links within the modalframe (node/edit etc) and inside child.jd there is a function that looks for "external links". However the function does not really seems to look for anything else than a "empty" href-attr OR a one that starts with a "#"(fragment).
To solve this I added a clause to the if-statment which also (and not) looks for:
* http (not)
* https (not)
* "/"
if (!href || href.length <= 0 || href.match(/^(http|https)/) == null && href.match(/^(#|\/|.)/))
I supplied a patch to be reviewed.
Comment | File | Size | Author |
---|---|---|---|
child_js_fix_External_links.patch | 557 bytes | bobodrone |
Comments
Comment #1
tobey_p CreditAttribution: tobey_p commentedI think it would be a good idea to combine this patch with the patch over there, cause it adds to the same line of code:
http://drupal.org/node/1166990#comment-4838476
Comment #2
dsnopekActually, it's not meant to look for "external URLs" - really, it's trying to find any 'a' tag that's a valid link to another URL. This could include relative URLs which won't start with http/https like your patch is checking for. To looks to be working as designed!