Skip to content

Commit 59fbdf7

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fix bug #79944
2 parents 657707a + 5b8b480 commit 59fbdf7

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

ext/standard/dns.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ PHP_FUNCTION(dns_get_mx)
11241124
}
11251125
}
11261126
php_dns_free_handle(handle);
1127-
RETURN_TRUE;
1127+
RETURN_BOOL(zend_hash_num_elements(Z_ARRVAL_P(weight_list)) != 0);
11281128
}
11291129
/* }}} */
11301130
#endif /* HAVE_FULL_DNS_FUNCS */

ext/standard/tests/network/getmxrr.phpt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,19 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
1010
?>
1111
--FILE--
1212
<?php
13-
$domains = array( 'mx1.tests.php.net', 'mx2.tests.php.net' );
14-
foreach ( $domains as $domain )
15-
{
16-
if ( getmxrr( $domain, $hosts, $weights ) )
17-
{
18-
echo "Hosts: " . count( $hosts ) . ", weights: " . count( $weights ) . "\n";
19-
}
13+
$domains = array(
14+
'mx1.tests.php.net',
15+
'mx2.tests.php.net',
16+
'qa.php.net',
17+
);
18+
foreach ($domains as $domain) {
19+
$result = getmxrr($domain, $hosts, $weights);
20+
echo "Result: " . ($result ? "true" : "false")
21+
. ", hosts: " . count( $hosts )
22+
. ", weights: " . count( $weights ) . "\n";
2023
}
2124
?>
2225
--EXPECT--
23-
Hosts: 1, weights: 1
24-
Hosts: 2, weights: 2
26+
Result: true, hosts: 1, weights: 1
27+
Result: true, hosts: 2, weights: 2
28+
Result: false, hosts: 0, weights: 0

0 commit comments

Comments
 (0)