update bind9.php
authorStricted <info@stricted.net>
Wed, 3 Aug 2016 14:09:02 +0000 (16:09 +0200)
committerStricted <info@stricted.net>
Wed, 3 Aug 2016 14:09:02 +0000 (16:09 +0200)
bind9.php

index 3133c6a2fe3d0984a592efef8dd29f0bf3434846..f34bc2a02bde33a6d6ebade838a53297dbe4435a 100644 (file)
--- 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) {