Skip to content

Commit 5330f11

Browse files
bwalkerlbrendanheywood
authored andcommittedFeb 1, 2024
CI Checks
1 parent 2f2d1a5 commit 5330f11

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed
 

‎classes/check/dnsmx.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ public function get_result() : result {
7979
$status = result::ERROR;
8080
$summary = "MX DNS record missing";
8181
} else {
82-
$allmxdomains = join('<br>', array_map(fn($x) => $x['target'] . ' (' . $x['pri'] . ')', $mxdomains));
82+
$allmxdomains = join('<br>', array_map(function($x) {
83+
return $x['target'] . ' (' . $x['pri'] . ')';
84+
}, $mxdomains));
8385
$details .= "<p>MX record found on domain <code>$noreplydomain</code> pointing to<br><code>$allmxdomains</code></p>";
8486
$status = result::OK;
8587
$summary = "MX record points to " . $mxdomains[0]['target'];

‎classes/dns_util.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public function get_subdomains($domain) {
9898

9999
/**
100100
* Get spf txt record contents
101+
* @param string $domain specify a different domain
101102
* @return string txt record
102103
*/
103104
public function get_spf_record($domain = '') {
@@ -134,7 +135,7 @@ public function get_mxtoolbox_spf_url() {
134135
* Returns the include if matched
135136
*
136137
* The include can have a wildcard and this will return the actual matched value.
137-
* @param string include domain
138+
* @param string $include include domain
138139
* @return string matched include
139140
*/
140141
public function include_present(string $include) {
@@ -163,6 +164,8 @@ public function get_dkim_selector() {
163164

164165
/**
165166
* Get DKIM txt record contents
167+
* @param string $selector DKIM selector
168+
* @param string $domain DKIM domain
166169
* @return string txt record
167170
*/
168171
public function get_dkim_dns_domain($selector, $domain) {
@@ -171,6 +174,7 @@ public function get_dkim_dns_domain($selector, $domain) {
171174

172175
/**
173176
* Get DKIM txt record contents
177+
* @param string $selector DKIM selector
174178
* @return string txt record
175179
*/
176180
public function get_dkim_record($selector) {
@@ -187,7 +191,7 @@ public function get_dkim_record($selector) {
187191

188192
/**
189193
* Get DKIM txt record contents
190-
* @return string txt record
194+
* @return array txt record
191195
*/
192196
public function get_dmarc_dns_record() {
193197
$domain = $this->get_noreply_domain();
@@ -215,13 +219,14 @@ public function get_dmarc_dns_record() {
215219

216220
/**
217221
* Get MX record contents
218-
* @return string txt record
222+
* @param string $domain domain to check
223+
* @return array txt record
219224
*/
220225
public function get_mx_record($domain) {
221226

222227
$records = @dns_get_record($domain, DNS_MX);
223228
if (empty($records)) {
224-
return;
229+
return [];
225230
}
226231
usort($records, function($a, $b) {
227232
if ($a['pri'] == $b['pri']) {
@@ -234,6 +239,8 @@ public function get_mx_record($domain) {
234239

235240
/**
236241
* Get matching record contents
242+
* @param string $domain domain to check
243+
* @param string $match search for specific match
237244
* @return string txt record
238245
*/
239246
public function get_matching_dns_record($domain, $match) {

0 commit comments

Comments
 (0)
Please sign in to comment.