mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 16:00:26 +01:00
fixes #4966
This commit is contained in:
@@ -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
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user