mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
Fix #987 error in URI.js when invalid URL is supplied
This commit is contained in:
parent
46aa82d63b
commit
ed3696ae93
1 changed files with 6 additions and 2 deletions
|
|
@ -39,6 +39,10 @@
|
|||
if (url1.match(/^\.?\/[^\/]*/) || url2.match(/^\.?\/[^\/]*/)) {
|
||||
return true;
|
||||
}
|
||||
if (url1.match(/^(https?:)?\/\/[^\/]*[^a-z0-9\/.:_-]/i) || url2.match(/^(https?:)?\/\/[^\/]*[^a-z0-9\/.:_-]/i)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
url1 = window.XE.URI(url1).normalizePort().normalizePathname().origin();
|
||||
url2 = window.XE.URI(url2).normalizePort().normalizePathname().origin();
|
||||
return (url1 === url2) ? true : false;
|
||||
|
|
@ -208,10 +212,10 @@
|
|||
if (typeof url !== "string") {
|
||||
return false;
|
||||
}
|
||||
if (url.match(/^\.?\/[^\/]*/)) {
|
||||
if (url.match(/^\.?\/[^\/]/)) {
|
||||
return true;
|
||||
}
|
||||
if (url.match(/^\w+:[^\/]*$/)) {
|
||||
if (url.match(/^\w+:[^\/]*$/) || url.match(/^(https?:)?\/\/[^\/]*[^a-z0-9\/.:_-]/i)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue