From 00f5f744d0306097b7d2ff2f88fe2bf4a9fda612 Mon Sep 17 00:00:00 2001 From: Ashus Date: Thu, 9 Jul 2020 15:40:44 +0200 Subject: [PATCH] [Web] Allow underscore and hyphen in DKIM selector (#3643) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change allows to have cleaner DNS zones as mail security related entries usually begin with _. Co-authored-by: Václav Silber --- data/web/inc/functions.dkim.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/web/inc/functions.dkim.inc.php b/data/web/inc/functions.dkim.inc.php index 72220ee1..46d66d31 100644 --- a/data/web/inc/functions.dkim.inc.php +++ b/data/web/inc/functions.dkim.inc.php @@ -34,7 +34,7 @@ function dkim($_action, $_data = null, $privkey = false) { ); continue; } - if (!ctype_alnum($dkim_selector)) { + if (!ctype_alnum(str_replace(['-', '_'], '', $dkim_selector))) { $_SESSION['return'][] = array( 'type' => 'danger', 'log' => array(__FUNCTION__, $_action, $_data, $privkey),