]> granicus.if.org Git - php/commitdiff
MFB: Improved parameter handling
authorIlia Alshanetsky <iliaa@php.net>
Sat, 7 Mar 2009 21:56:52 +0000 (21:56 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 7 Mar 2009 21:56:52 +0000 (21:56 +0000)
sapi/apache_hooks/php_apache.c

index b46528aeae3820e76b1e5c130d5910c45d30d526..52bd180570a16510a64f046d570c494b2025e621 100644 (file)
@@ -713,7 +713,7 @@ PHP_FUNCTION(apache_request_server_port)
 PHP_FUNCTION(apache_request_remote_host)
 {
        zval *id;
-       long ztype;
+       long ztype = NULL;
        request_rec *r;
        char *res;
        int type = REMOTE_NAME;
@@ -722,15 +722,10 @@ PHP_FUNCTION(apache_request_remote_host)
                return;
        }
 
-       switch (ZEND_NUM_ARGS()) {
-               case 0:
-                       break;
-               case 1:
-                       type = ztype;
-                       break;
+       if (ztype) {
+               type = ztype;
        }
 
-
        APREQ_GET_REQUEST(id, r);
 
        res = (char *)ap_get_remote_host(r->connection, r->per_dir_config, type);