@@ -210,9 +210,9 @@ PHP_FUNCTION(gethostbyname)
210
210
Z_PARAM_STRING (hostname , hostname_len )
211
211
ZEND_PARSE_PARAMETERS_END ();
212
212
213
- if (hostname_len > MAXFQDNLEN ) {
213
+ if (hostname_len > MAXFQDNLEN ) {
214
214
/* name too long, protect from CVE-2015-0235 */
215
- php_error_docref (NULL , E_WARNING , "Host name is too long, the limit is %d characters" , MAXFQDNLEN );
215
+ php_error_docref (NULL , E_WARNING , "Host name cannot be longer than %d characters" , MAXFQDNLEN );
216
216
RETURN_STRINGL (hostname , hostname_len );
217
217
}
218
218
@@ -233,9 +233,9 @@ PHP_FUNCTION(gethostbynamel)
233
233
Z_PARAM_STRING (hostname , hostname_len )
234
234
ZEND_PARSE_PARAMETERS_END ();
235
235
236
- if (hostname_len > MAXFQDNLEN ) {
236
+ if (hostname_len > MAXFQDNLEN ) {
237
237
/* name too long, protect from CVE-2015-0235 */
238
- php_error_docref (NULL , E_WARNING , "Host name is too long, the limit is %d characters" , MAXFQDNLEN );
238
+ php_error_docref (NULL , E_WARNING , "Host name cannot be longer than %d characters" , MAXFQDNLEN );
239
239
RETURN_FALSE ;
240
240
}
241
241
@@ -393,8 +393,8 @@ PHP_FUNCTION(dns_check_record)
393
393
else if (!strcasecmp ("NAPTR" , rectype )) type = DNS_T_NAPTR ;
394
394
else if (!strcasecmp ("A6" , rectype )) type = DNS_T_A6 ;
395
395
else {
396
- php_error_docref ( NULL , E_WARNING , "Type '%s' not supported" , rectype );
397
- RETURN_FALSE ;
396
+ zend_argument_value_error ( 2 , "must be a valid DNS record type" );
397
+ RETURN_THROWS () ;
398
398
}
399
399
}
400
400
@@ -837,14 +837,13 @@ PHP_FUNCTION(dns_get_record)
837
837
838
838
if (!raw ) {
839
839
if ((type_param & ~PHP_DNS_ALL ) && (type_param != PHP_DNS_ANY )) {
840
- php_error_docref ( NULL , E_WARNING , "Type '" ZEND_LONG_FMT "' not supported" , type_param );
841
- RETURN_FALSE ;
840
+ zend_argument_value_error ( 2 , "must be a DNS_* constant" );
841
+ RETURN_THROWS () ;
842
842
}
843
843
} else {
844
844
if ((type_param < 1 ) || (type_param > 0xFFFF )) {
845
- php_error_docref (NULL , E_WARNING ,
846
- "Numeric DNS record type must be between 1 and 65535, '" ZEND_LONG_FMT "' given" , type_param );
847
- RETURN_FALSE ;
845
+ zend_argument_value_error (2 , "must be between 1 and 65535 when argument #5 ($raw) is true" );
846
+ RETURN_THROWS ();
848
847
}
849
848
}
850
849
0 commit comments