From: Stricted Date: Wed, 3 Aug 2016 14:09:02 +0000 (+0200) Subject: update bind9.php X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a8491e0e2a7f887eb075e3235c3b2f30233cea1a;p=GitHub%2FStricted%2FDomain-Control-Panel.git update bind9.php --- diff --git a/bind9.php b/bind9.php index 3133c6a..f34bc2a 100644 --- a/bind9.php +++ b/bind9.php @@ -38,14 +38,18 @@ if (is_array($data) && !isset($data['error'])) { else if ($record['type'] == "TXT") { $txt = $record['data']; - if (strpos($txt, " ") !== false) { - if (substr($txt, -1) != '"' && substr($txt, 0, 1) != '"') { - $record['data'] = '"'.$txt.'"'; + if (strpos($txt, " ") !== false && strpos($txt, '" "') !== false && $txt != '" "') { + if (substr($txt, 0, 1) != '(' && substr($txt, -1) != ')') { + if (substr($txt, 0, 1) != '"' && substr($txt, -1) != '"') { + $record['data'] = '("'.$txt.'")'; + } + else { + $record['data'] = '('.$txt.')'; + } } } - - if (strpos($txt, '" "') !== false && $txt != '" "') { - $record['data'] = '('.$record['data'].')'; // for dkim records + else if (substr($txt, 0, 1) != '"' && substr($txt, -1) != '"') { + $record['data'] = '"'.$txt.'"'; } if (strpos($record['data'], "v=spf1") !== false) {