Skip to content

Commit

Permalink
use DokuWiki's mail_isvalid to validate email address, fixes #119
Browse files Browse the repository at this point in the history
  • Loading branch information
phy25 committed Mar 14, 2019
1 parent 2537e35 commit 43aa359
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions action/banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ function showBanner() {

global $INFO;
if ($this->getConf('apr_mail_receiver') !== '' && $INFO['isadmin']) {
$validator = new EmailAddressValidator();
$validator->allowLocalAddresses = true;
$addr = $this->getConf('apr_mail_receiver');
if(!$validator->check_email_address($addr)) {
if(!mail_isvalid($addr)) {
msg(sprintf($this->getLang('mail_invalid'),htmlspecialchars($addr)),-1);
}

Expand Down
6 changes: 2 additions & 4 deletions action/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ function send_change_mail(&$event, $param) {

// get mail receiver
$receiver = $this->getConf('apr_mail_receiver');
$validator = new EmailAddressValidator();
$validator->allowLocalAddresses = true;
if(!$validator->check_email_address($receiver)) {
dbglog(sprintf($this->getLang('mail_invalid'),htmlspecialchars($receiver)));
if(!mail_isvalid($receiver)) {
dbglog(sprintf($this->getLang('mail_invalid'), htmlspecialchars($receiver)));
return false;
}

Expand Down

0 comments on commit 43aa359

Please sign in to comment.