This commit is contained in:
Julian Lam
2016-08-22 16:24:28 -04:00
parent de49de3c56
commit 60ea7d5121
4 changed files with 19 additions and 6 deletions

View File

@@ -431,6 +431,14 @@
}
return utils.props(obj[prop], newProps, value);
},
isInternalURI: function(targetLocation, referenceLocation, relative_path) {
return targetLocation.host === '' || // Relative paths are always internal links
(
targetLocation.host === referenceLocation.host && targetLocation.protocol === referenceLocation.protocol && // Otherwise need to check if protocol and host match
(relative_path.length > 0 ? targetLocation.pathname.indexOf(relative_path) === 0 : true) // Subfolder installs need this additional check
);
}
};