fix ws
[m6w6/ext-json_post] / php_json_post.c
index f767b22b7e738513a342350bdfbda2b47414e011..772018dc540dce78297109b5168b2e1f3220282e 100644 (file)
@@ -25,7 +25,7 @@
 ZEND_DECLARE_MODULE_GLOBALS(json_post);
 
 PHP_INI_BEGIN()
-    STD_PHP_INI_ENTRY("json_post.flags", "1", PHP_INI_PERDIR, OnUpdateLong, flags, zend_json_post_globals, json_post_globals)
+       STD_PHP_INI_ENTRY("json_post.flags", "1", PHP_INI_PERDIR, OnUpdateLong, flags, zend_json_post_globals, json_post_globals)
        STD_PHP_INI_ENTRY("json_post.error_response", "0", PHP_INI_PERDIR, OnUpdateLong, error_response, zend_json_post_globals, json_post_globals)
        STD_PHP_INI_ENTRY("json_post.error_exit", "0", PHP_INI_PERDIR, OnUpdateBool, error_exit, zend_json_post_globals, json_post_globals)
 PHP_INI_END()
@@ -161,6 +161,8 @@ static SAPI_POST_HANDLER_FUNC(php_json_post_handler)
                        sapi_send_headers(TSRMLS_C);
                        zend_bailout();
                }
+               /* ext/json in PHP-7 fails to reset error_code in RINIT */
+               JSON_G(error_code) = 0;
        }
 }