]> granicus.if.org Git - php/commitdiff
- revert last commit (tree was not updated)
authorPierre Joye <pajoye@php.net>
Mon, 16 Mar 2009 10:08:51 +0000 (10:08 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 16 Mar 2009 10:08:51 +0000 (10:08 +0000)
sapi/apache_hooks/php_apache.c

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