mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-05-02 14:36:08 -04:00
avoid use of bleeding edge function
only supported in Firefox & Chrome >= 120 & node >= 19.9.0 & 18.17.0
This commit is contained in:
parent
a80bd4e4ea
commit
cc0b6e387a
4 changed files with 7 additions and 10 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue