-+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "REMOTE_ADDR", sizeof("REMOTE_ADDR"), (void **) &remote_addr)==SUCCESS) {
-+ convert_to_string_ex(remote_addr);
-+ fprintf(sendmail, "HTTP-Posting-Client: %s\n", Z_STRVAL_PP(remote_addr));
-+ }
-+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SERVER_NAME", sizeof("SERVER_NAME"), (void **) &server_name)==SUCCESS) {
-+ convert_to_string_ex(server_name);
-+ fprintf(sendmail, "HTTP-Posting-URI: %s", Z_STRVAL_PP(server_name));
-+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SERVER_PORT", sizeof("SERVER_PORT"), (void **) &server_port)==SUCCESS) {
-+ convert_to_string_ex(server_port);
-+ fprintf(sendmail, ":%s", Z_STRVAL_PP(server_port));
-+ }
-+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SCRIPT_NAME", sizeof("SCRIPT_NAME"), (void **) &script_name)==SUCCESS) {
-+ convert_to_string_ex(script_name);
-+ fprintf(sendmail, "%s", Z_STRVAL_PP(script_name));
-+ }
-+ fprintf(sendmail, "\n");
-+ }
-+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &http_user_agent)==SUCCESS) {
-+ convert_to_string_ex(http_user_agent);
-+ fprintf(sendmail, "HTTP-Posting-User-Agent: %s\n", Z_STRVAL_PP(http_user_agent));
-+ }
++ if (remote_addr && Z_TYPE_P(remote_addr) == IS_STRING)
++ fprintf(sendmail, "HTTP-Posting-Client: %s\n", Z_STRVAL_P(remote_addr));
++ if (server_name && Z_TYPE_P(server_name) == IS_STRING) {
++ fprintf(sendmail, "HTTP-Posting-URI: %s", Z_STRVAL_P(server_name));
++ if (server_port && Z_TYPE_P(server_port) == IS_STRING)
++ fprintf(sendmail, ":%s", Z_STRVAL_P(server_port));
++ if (script_name && Z_TYPE_P(script_name) == IS_STRING)
++ fprintf(sendmail, "%s", Z_STRVAL_P(script_name));
++ fprintf(sendmail, "\n");
++ }
++ if (http_user_agent && Z_TYPE_P(http_user_agent) == IS_STRING)
++ fprintf(sendmail, "HTTP-Posting-User-Agent: %s\n", Z_STRVAL_P(http_user_agent));