Skip to content

Commit

Permalink
CI Checks
Browse files Browse the repository at this point in the history
  • Loading branch information
bwalkerl committed Jan 31, 2024
1 parent 7ce7cc6 commit cfa5756
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions classes/dns_util.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public function get_subdomains($domain) {

/**
* Get spf txt record contents
* @param string $domain specify a different domain
* @return string txt record
*/
public function get_spf_record($domain = '') {
Expand Down Expand Up @@ -134,7 +135,7 @@ public function get_mxtoolbox_spf_url() {
* Returns the include if matched
*
* The include can have a wildcard and this will return the actual matched value.
* @param string include domain
* @param string $include include domain
* @return string matched include
*/
public function include_present(string $include) {
Expand Down Expand Up @@ -163,6 +164,8 @@ public function get_dkim_selector() {

/**
* Get DKIM txt record contents
* @param string $selector DKIM selector
* @param string $domain DKIM domain
* @return string txt record
*/
public function get_dkim_dns_domain($selector, $domain) {
Expand All @@ -171,6 +174,7 @@ public function get_dkim_dns_domain($selector, $domain) {

/**
* Get DKIM txt record contents
* @param string $selector DKIM selector
* @return string txt record
*/
public function get_dkim_record($selector) {
Expand All @@ -187,7 +191,7 @@ public function get_dkim_record($selector) {

/**
* Get DKIM txt record contents
* @return string txt record
* @return array txt record
*/
public function get_dmarc_dns_record() {
$domain = $this->get_noreply_domain();
Expand Down Expand Up @@ -215,13 +219,14 @@ public function get_dmarc_dns_record() {

/**
* Get MX record contents
* @return string txt record
* @param string $domain domain to check
* @return array txt record
*/
public function get_mx_record($domain) {

$records = @dns_get_record($domain, DNS_MX);
if (empty($records)) {
return;
return [];
}
usort($records, function($a, $b) {
if ($a['pri'] == $b['pri']) {
Expand All @@ -234,6 +239,8 @@ public function get_mx_record($domain) {

/**
* Get matching record contents
* @param string $domain domain to check
* @param string $match search for specific match
* @return string txt record
*/
public function get_matching_dns_record($domain, $match) {
Expand Down

0 comments on commit cfa5756

Please sign in to comment.