From: Máté Kocsis Date: Wed, 20 Nov 2019 01:22:44 +0000 (+0100) Subject: Promote warning to exception in dns_check_record() function X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9585964dd747267742167342a78af7714f9c830b;p=php Promote warning to exception in dns_check_record() function GH-5004 --- diff --git a/ext/standard/dns.c b/ext/standard/dns.c index c3a9b9cde6..d46226aafd 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -383,8 +383,8 @@ PHP_FUNCTION(dns_check_record) ZEND_PARSE_PARAMETERS_END(); if (hostname_len == 0) { - php_error_docref(NULL, E_WARNING, "Host cannot be empty"); - RETURN_FALSE; + zend_value_error("Host cannot be empty"); + return; } if (rectype) { diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index 5dc39a104b..1221cbb6fb 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -107,8 +107,8 @@ PHP_FUNCTION(dns_check_record) } if (hostname_len == 0) { - php_error_docref(NULL, E_WARNING, "Host cannot be empty"); - RETURN_FALSE; + zend_value_error("Host cannot be empty"); + return; } if (rectype) { diff --git a/ext/standard/tests/network/bug41347.phpt b/ext/standard/tests/network/bug41347.phpt index 6ece098191..6390327a52 100644 --- a/ext/standard/tests/network/bug41347.phpt +++ b/ext/standard/tests/network/bug41347.phpt @@ -2,8 +2,11 @@ dns_check_record() segfault with empty host --FILE-- getMessage() . "\n"; +} ?> ---EXPECTF-- -Warning: dns_check_record(): Host cannot be empty in %s on line %d -bool(false) +--EXPECT-- +Host cannot be empty