summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2013-07-03 00:15:13 +0200
committerBenny Baumann <BenBE@geshi.org>2013-07-03 00:15:13 +0200
commit17e83d655a754586d9f0f249aefca6f0af0beee4 (patch)
tree564ccab86cacc1ed08f3c62341d4742760580571
parent9a81215af81d5c204b98e4771d116cae66c95bb6 (diff)
downloadcacert-devel-17e83d655a754586d9f0f249aefca6f0af0beee4.tar.gz
cacert-devel-17e83d655a754586d9f0f249aefca6f0af0beee4.tar.xz
cacert-devel-17e83d655a754586d9f0f249aefca6f0af0beee4.zip
bug 1186: Fix warning if no valid MX records are returned for one line of the executed command
-rw-r--r--includes/general.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/includes/general.php b/includes/general.php
index bcbe38d..abc8611 100644
--- a/includes/general.php
+++ b/includes/general.php
@@ -543,10 +543,15 @@
#echo `dig +short mx heise.de 2>&1`."-<br>\n";
$list = explode("\n", $line);
- foreach($list as $row)
- list($pri, $mxhosts[]) = explode(" ", substr(trim($row), 0, -1));
+ foreach($list as $row) {
+ if(!strstr(" ", $row)) {
+ continue;
+ }
+ list($pri, $mxhosts[]) = explode(" ", trim($row), 2);
+ }
$mxhosts[] = $domain;
-#print_r($mxhosts); die;
+ array_walk($mxhosts, function(&$mx) { $mx = trim($mx); } );
+
foreach($mxhosts as $key => $domain)
{
$fp = @fsockopen($domain,25,$errno,$errstr,5);