Skip to content

Commit 5b8b480

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix bug #79944
2 parents 2830c3e + a06eed0 commit 5b8b480

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ PHP NEWS
2828
- Standard:
2929
. Fixed bug #79930 (array_merge_recursive() crashes when called with array
3030
with single reference). (Nikita)
31+
. Fixed bug #79944 (getmxrr always returns true on Alpine linux). (Nikita)
3132

3233
- XML:
3334
. Fixed bug #79922 (Crash after multiple calls to xml_parser_free()). (cmb)

ext/standard/dns.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ PHP_FUNCTION(dns_get_mx)
11351135
}
11361136
}
11371137
php_dns_free_handle(handle);
1138-
RETURN_TRUE;
1138+
RETURN_BOOL(zend_hash_num_elements(Z_ARRVAL_P(weight_list)) != 0);
11391139
}
11401140
/* }}} */
11411141
#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)