Added a sanity check (hopefuly will fix bug #20109). According to

http://developer.netscape.com/docs/manuals/enterprise/40/nsapi/05_nsapi.htm#551539
util_hostname() can return a NULL value.
This commit is contained in:
Ilia Alshanetsky 2002-10-26 22:00:36 +00:00
parent 65b79b3595
commit d5870ef544

View File

@ -318,7 +318,9 @@ sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_DC)
}
sprintf(buf, "%d", conf_getglobals()->Vport);
php_register_variable("SERVER_PORT", buf, track_vars_array TSRMLS_CC );
php_register_variable("SERVER_NAME", util_hostname(), track_vars_array TSRMLS_CC );
if ((value = util_hostname())) {
php_register_variable("SERVER_NAME", value, track_vars_array TSRMLS_CC );
}
php_register_variable("SERVER_URL", http_uri2url("", ""), track_vars_array TSRMLS_CC );
php_register_variable("HTTPS", (security_active ? "ON" : "OFF"), track_vars_array TSRMLS_CC );
/* php_register_variable("SERVER_SOFTWARE", MAGNUS_VERSION_STRING, track_vars_array TSRMLS_CC ); */