mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Fix JS error when either url1 or url2 is undefined in isSameOrigin()
This commit is contained in:
parent
bc17e4b2d5
commit
01ee23b7d9
1 changed files with 1 additions and 0 deletions
|
|
@ -33,6 +33,7 @@
|
|||
* @brief Check if two URLs belong to the same origin
|
||||
*/
|
||||
window.isSameOrigin = function(url1, url2) {
|
||||
if(!url1 || !url2) return false;
|
||||
url1 = window.XE.URI(url1).normalizePort().normalizePathname().origin();
|
||||
url2 = window.XE.URI(url2).normalizePort().normalizePathname().origin();
|
||||
return (url1 === url2) ? true : false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue