PHP_FUNCTION(apache_request_remote_host)
{
zval *id;
- long ztype = NULL;
+ 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 (ztype) {
- 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);