add max-age to http\Cookie
[m6w6/ext-http] / php_http_env.c
index c11e4fcca5d3e7c996b5dd3144bd8b07fd766cc9..c8c3d2c974f845e37fbf93c822d9356350298a8c 100644 (file)
@@ -42,8 +42,6 @@ PHP_RINIT_FUNCTION(http_env)
                                if (SUCCESS == zend_hash_find(&SG(known_post_content_types), key_str, key_len, (void *) &post_entry)) {
                                        zval *files = PG(http_globals)[TRACK_VARS_FILES];
 
-                                       zend_is_auto_global(ZEND_STRL("_POST") TSRMLS_CC);
-
                                        if (post_entry) {
                                                SG(request_info).post_entry = post_entry;
 
@@ -1021,7 +1019,13 @@ PHP_METHOD(HttpEnv, cleanPersistentHandles)
 static SAPI_POST_HANDLER_FUNC(php_http_json_post_handler)
 {
        if (SG(request_info).raw_post_data) {
-               php_json_decode(arg, SG(request_info).raw_post_data, SG(request_info).raw_post_data_length, 1, PG(max_input_nesting_level) TSRMLS_CC);
+               zval *zarg = arg;
+               zval_dtor(zarg);
+               ZVAL_NULL(zarg);
+               php_json_decode(zarg, SG(request_info).raw_post_data, SG(request_info).raw_post_data_length, 1, PG(max_input_nesting_level) TSRMLS_CC);
+               if (Z_TYPE_P(zarg) == IS_NULL) {
+                       array_init(zarg);
+               }
        }
 }