From 9d3030d5f367729197756c7ecb4feab713850bf6 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 7 Mar 2009 21:56:43 +0000 Subject: Improved parameter handling --- sapi/apache_hooks/php_apache.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'sapi/apache_hooks/php_apache.c') diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c index 86e43962dd..a3677b80f2 100644 --- a/sapi/apache_hooks/php_apache.c +++ b/sapi/apache_hooks/php_apache.c @@ -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); -- cgit v1.2.1