avoid use of bleeding edge function

only supported in Firefox & Chrome >= 120 & node >= 19.9.0 & 18.17.0
This commit is contained in:
El RIDO 2024-01-04 23:23:47 +01:00
parent a80bd4e4ea
commit cc0b6e387a
4 changed files with 7 additions and 10 deletions

View file

@ -2119,7 +2119,11 @@ jQuery.PrivateBin = (function($, RawDeflate) {
if (typeof response === 'string' && response.length > 0) {
const shortUrlMatcher = /https?:\/\/[^\s]+/g;
const shortUrl = (response.match(shortUrlMatcher) || []).filter(function(a) {
return URL.canParse(a);
try {
return !!new URL(a);
} catch (error) {
return false;
}
}).sort(function(a, b) {
return a.length - b.length;
})[0];