From 4772cf38fc777b3a865dceb9bbdde6d5854d7ea3 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 29 Apr 2020 19:58:59 +0200 Subject: [PATCH] suppress errors messages in Mailer for non-admins #3014 When ever a mail is sent to the current user, it is usually the only receiver. If in that case the mail validation fails, sending the whole mail will fail which will be signalled by a return false of the Mailer->send() method anyway. This is already signalled to the user. The more commoin usecase of a validation error is when other people's addresses fail to validate. These should never be shown to a user. --- inc/Mailer.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 64ba8a0ce..eb44583b9 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -389,12 +389,12 @@ class Mailer { // FIXME: is there a way to encode the localpart of a emailaddress? if(!\dokuwiki\Utf8\Clean::isASCII($addr)) { - msg(hsc("E-Mail address <$addr> is not ASCII"), -1); + msg(hsc("E-Mail address <$addr> is not ASCII"), -1, __LINE__, __FILE__, MSG_ADMINS_ONLY); continue; } if(!mail_isvalid($addr)) { - msg(hsc("E-Mail address <$addr> is not valid"), -1); + msg(hsc("E-Mail address <$addr> is not valid"), -1, __LINE__, __FILE__, MSG_ADMINS_ONLY); continue; } -- 2.11.4.GIT