iliaa Sat Oct 26 18:00:36 2002 EDT
Modified files:
/php4/sapi/nsapi nsapi.c
Log:
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.
Index: php4/sapi/nsapi/nsapi.c
diff -u php4/sapi/nsapi/nsapi.c:1.27 php4/sapi/nsapi/nsapi.c:1.28
--- php4/sapi/nsapi/nsapi.c:1.27 Wed Sep 18 17:57:34 2002
+++ php4/sapi/nsapi/nsapi.c Sat Oct 26 18:00:36 2002
@@ -318,7 +318,9 @@
}
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 ); */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php