From c6eef6aa0a784c99733409013cdaa01489af974e Mon Sep 17 00:00:00 2001 From: coomdev Date: Tue, 12 Apr 2022 20:24:49 +0200 Subject: [PATCH] remove 6-character-filenames matching --- src/pomf.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pomf.ts b/src/pomf.ts index 0552985..6aca36b 100644 --- a/src/pomf.ts +++ b/src/pomf.ts @@ -16,15 +16,13 @@ settings.subscribe(b => { }); const getExt = (fn: string) => { - const isDum = fn!.match(/^[a-z0-9]{6}\./i); +// const isDum = fn!.match(/^[a-z0-9]{6}\./i); const isB64 = fn!.match(/^((?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=))?\.(gif|jpe?g|png|webm)/); const isExt = fn!.match(/\[.*=(.*)\]/); let ext; let source: string | undefined; try { - if (isDum) { - ext = fn.split('.').slice(0, -1).join('.'); - } else if (isB64) { + if (isB64) { ext = atob(isB64[1]); } else if (isExt) { ext = decodeURIComponent(isExt[1]);