Fix regex bug when saving paths in the form https://domain.com/file/

This commit is contained in:
Gio 2019-12-31 19:28:19 -06:00
parent 9bcfcfb2ee
commit d65c0b364e
1 changed files with 1 additions and 1 deletions

2
Plugins/SaveToRedux/SaveToRedux.plugin.js Executable file → Normal file
View File

@ -361,7 +361,7 @@ var SaveToRedux = (() => {
else url = url.replace('.webp', '.png');
let fileName = url.substr(url.lastIndexOf('/') + 1);
if (requiresSize) url += '?size=2048';
const match = fileName.match(/([^\/\.]+)(?:\.([0-9a-zA-Z]+))?([^\/]+)?$/);
const match = url.match(/([^\/\.]+)(?:\.([0-9a-zA-Z]+))?([^\/]+)?(\/){0,1}$/);
let name = customName || match[1];
let extension = match[2];
if (url.indexOf('//media.tenor.co') !== -1) {