]> granicus.if.org Git - php/commitdiff
- fix vc6 build
authorPierre Joye <pajoye@php.net>
Mon, 16 Mar 2009 09:59:16 +0000 (09:59 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 16 Mar 2009 09:59:16 +0000 (09:59 +0000)
sapi/apache_hooks/php_apache.c

index e6b61bb9b93f24a39598b73f2104526bef3d288b..67d6aef295b59d3066adf14d4e8156044470e169 100644 (file)
@@ -713,21 +713,23 @@ PHP_FUNCTION(apache_request_server_port)
 PHP_FUNCTION(apache_request_remote_host)
 {
        zval *id;
-       long type = 0;
+       long ztype;
        request_rec *r;
        char *res;
+       int type = REMOTE_NAME;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &type) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &ztype) == FAILURE) {
                return;
        }
 
-       if (!type) {
-               type = REMOTE_NAME
+       if (ZEND_NUM_ARGS() == 1) {
+               type = ztype;
        }
 
+
        APREQ_GET_REQUEST(id, r);
 
-       res = (char *)ap_get_remote_host(r->connection, r->per_dir_config, (int)type);
+       res = (char *)ap_get_remote_host(r->connection, r->per_dir_config, type);
 
        if (res) {
                RETURN_STRING(res, 1);