Completely ignore remote links

There are no issues with "returning true" so this should be the
preferred way. No need to fall back on "window.open" here.

fixes #6159
This commit is contained in:
Thomas Gelf 2014-05-09 11:41:18 +00:00
parent e70ca26427
commit 23679c0078
1 changed files with 6 additions and 1 deletions

View File

@ -420,8 +420,13 @@
var formerUrl;
var remote = /^(?:[a-z]+:)\/\//;
// Let remote links pass through
if (href.match(remote)) {
return true;
}
// window.open is used as return true; didn't work reliable
if (linkTarget === '_blank' || linkTarget === '_self' || href.match(remote)) {
if (linkTarget === '_blank' || linkTarget === '_self') {
window.open(href, linkTarget);
return false;
}