From 9332e287abdb76dc2fdb1b8fd6022e5177e2d00a Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Sat, 25 May 2019 10:12:39 -0700 Subject: [PATCH] Removing the file extension check on images Since we're not checking mime types anyway, and most browser supported image formats should probably render as attachments on Mastodon and Pleroma, I'm removing this. There are often normal JPEG and PNG images that get linked as an img src but lack the standard file extensions, especially if it comes from an API that returns the file binary. Closes #36. --- updateFeeds.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updateFeeds.js b/updateFeeds.js index 618a89d..3760987 100644 --- a/updateFeeds.js +++ b/updateFeeds.js @@ -120,7 +120,7 @@ function transformContent(item) { images.each((i,e) => { let url = $(e).attr('src'); // if there's an image, add it as a media attachment - if (url && url.match(/(http)?s?:?(\/\/[^"']*\.(?:png|jpg|jpeg|gif|png|svg))/)) { + if (url) { //console.log(url); urls.push(url); // remove the image from the post body since it's in the attachment now