mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-04 05:52:44 +08:00
Bugfix: whitelist fails when empty or when using :
#938
This commit is contained in:
parent
6c14055006
commit
b2079f7263
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue