- fixed access of super globals
[m6w6/ext-http] / http_api.c
index 285c030836bc8ef2c6c3b1d80b06c19967d6b802..774e60335a1c70d7bb537bc6a6de88cacb8376e8 100644 (file)
@@ -116,7 +116,7 @@ void _http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC)
 
 #define HTTP_LOG_WRITE(file, type, msg) \
        if (file && *file) { \
-               php_stream *log = php_stream_open_wrapper(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT); \
+               php_stream *log = php_stream_open_wrapper_ex(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT); \
                 \
                if (log) { \
                        php_stream_printf(log TSRMLS_CC, "%s\t[%s]\t%s\t<%s>%s", datetime, type, msg, SG(request_info).request_uri, PHP_EOL); \
@@ -196,7 +196,9 @@ PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_size, zen
 {
        zval **hsv;
        zval **var;
-       
+#ifdef ZEND_ENGINE_2
+       zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC);
+#endif
        if ((SUCCESS != zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &hsv)) || (Z_TYPE_PP(hsv) != IS_ARRAY)) {
                return NULL;
        }