From b2079f72636b67619e1164e1dcbf90a9dd081d75 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Thu, 9 Feb 2023 16:16:50 +0100 Subject: [PATCH] Bugfix: whitelist fails when empty or when using `:` #938 --- dev/Model/Message.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/Model/Message.js b/dev/Model/Message.js index d7d4e54bf..1ed54bc24 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -402,19 +402,19 @@ export class MessageModel extends AbstractModel { regex = SettingsUserStore.viewImagesWhitelist() .trim() .replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&') - .replace(/[\s\r\n,;:]+/g, '|') + .replace(/[\s\r\n,;]+/g, '|') .replace(/\|+/g, '|'); if (regex) { console.log('whitelist images = '+regex); regex = new RegExp(regex); if (this.from[0]?.email.match(regex)) { - regex = 0; + regex = null; } } } let hasImages = false, isValid = src => { - if (!regex || src.match(regex)) { + if (null == regex || (regex && src.match(regex))) { return true; } hasImages = true;