Skip to content
Snippets Groups Projects
Commit 71d16d90 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #1174686 by ksenzee: overlay parent improperly opens child overlay on...

- Patch #1174686 by ksenzee: overlay parent improperly opens child overlay on specific external links.
parent 34623435
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -346,6 +346,10 @@ Drupal.overlay.setFocusBefore = function ($element, document) {
* TRUE if the URL represents an administrative link, FALSE otherwise.
*/
Drupal.overlay.isAdminLink = function (url) {
if (Drupal.overlay.isExternalLink(url)) {
return false;
}
var path = this.getPath(url);
// Turn the list of administrative paths into a regular expression.
......@@ -362,6 +366,20 @@ Drupal.overlay.isAdminLink = function (url) {
return this.adminPathRegExp.exec(path) && !this.nonAdminPathRegExp.exec(path);
};
/**
* Determine whether a link is external to the site.
*
* @param url
* The url to be tested.
*
* @return boolean
* TRUE if the URL is external to the site, FALSE otherwise.
*/
Drupal.overlay.isExternalLink = function (url) {
var re = RegExp('^((f|ht)tps?:)?//(?!' + window.location.host + ')');
return re.test(url);
};
/**
* Event handler: resizes overlay according to the size of the parent window.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment