File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -383,8 +383,8 @@ PHP_FUNCTION(dns_check_record)
383
383
ZEND_PARSE_PARAMETERS_END ();
384
384
385
385
if (hostname_len == 0 ) {
386
- php_error_docref ( NULL , E_WARNING , "Host cannot be empty" );
387
- RETURN_FALSE ;
386
+ zend_value_error ( "Host cannot be empty" );
387
+ return ;
388
388
}
389
389
390
390
if (rectype ) {
Original file line number Diff line number Diff line change @@ -107,8 +107,8 @@ PHP_FUNCTION(dns_check_record)
107
107
}
108
108
109
109
if (hostname_len == 0 ) {
110
- php_error_docref ( NULL , E_WARNING , "Host cannot be empty" );
111
- RETURN_FALSE ;
110
+ zend_value_error ( "Host cannot be empty" );
111
+ return ;
112
112
}
113
113
114
114
if (rectype ) {
Original file line number Diff line number Diff line change 2
2
dns_check_record() segfault with empty host
3
3
--FILE--
4
4
<?php
5
- var_dump (dns_check_record ('' ));
5
+ try {
6
+ var_dump (dns_check_record ('' ));
7
+ } catch (ValueError $ exception ) {
8
+ echo $ exception ->getMessage () . "\n" ;
9
+ }
6
10
?>
7
- --EXPECTF--
8
- Warning: dns_check_record(): Host cannot be empty in %s on line %d
9
- bool(false)
11
+ --EXPECT--
12
+ Host cannot be empty
You can’t perform that action at this time.
0 commit comments