Skip to content

Commit

Permalink
Merge pull request #46701 from Krishna2323/krishna2323/issue/46343
Browse files Browse the repository at this point in the history
fix: Attachment - A broken video file is loaded via action menu.
  • Loading branch information
danieldoglas authored Aug 9, 2024
2 parents 2ce9bf4 + f82422b commit db669c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/fileDownload/getAttachmentDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const getAttachmentDetails: GetAttachmentDetails = (html) => {
const IS_IMAGE_TAG = /<img([\w\W]+?)\/>/i.test(html);
const PREVIEW_SOURCE_REGEX = new RegExp(`${CONST.ATTACHMENT_PREVIEW_ATTRIBUTE}*=*"(.+?)"`, 'i');
const SOURCE_REGEX = new RegExp(`${CONST.ATTACHMENT_SOURCE_ATTRIBUTE}*=*"(.+?)"`, 'i');
const ORIGINAL_FILENAME_REGEX = IS_IMAGE_TAG ? new RegExp(`${CONST.ATTACHMENT_ORIGINAL_FILENAME_ATTRIBUTE}*=*"(.+?)"`, 'i') : new RegExp('<a[^>]*>([^<]+)</a>', 'i');
const ORIGINAL_FILENAME_REGEX = IS_IMAGE_TAG ? new RegExp(`${CONST.ATTACHMENT_ORIGINAL_FILENAME_ATTRIBUTE}*=*"(.+?)"`, 'i') : new RegExp('<(?:a|video)[^>]*>([^<]+)</(?:a|video)>', 'i');
if (!html) {
return {
previewSourceURL: null,
Expand Down

0 comments on commit db669c4

Please sign in to comment.