[mirotalk] - FIx is valid URL, update dep
This commit is contained in:
+8
-12
@@ -43,7 +43,7 @@ dependencies: {
|
||||
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
|
||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||
* @version 1.4.80
|
||||
* @version 1.4.81
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1874,17 +1874,13 @@ function isValidFileName(fileName) {
|
||||
* @param {string} str to check
|
||||
* @returns boolean true/false
|
||||
*/
|
||||
function isValidHttpURL(url) {
|
||||
const pattern = new RegExp(
|
||||
'^(https?:\\/\\/)?' + // protocol
|
||||
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
|
||||
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
|
||||
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
|
||||
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
|
||||
'(\\#[-a-z\\d_]*)?$',
|
||||
'i', // fragment locator
|
||||
);
|
||||
return pattern.test(url);
|
||||
function isValidHttpURL(input) {
|
||||
try {
|
||||
const url = new URL(input);
|
||||
return url.protocol === "http:" || url.protocol === "https:";
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user