From c257c6b60913ad43e74d7b5937f5c9f8144d8907 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Thu, 22 Jan 2015 09:34:35 +0100 Subject: [PATCH] simplify --- php_http_env.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/php_http_env.c b/php_http_env.c index eef0c37..99ea0e0 100644 --- a/php_http_env.c +++ b/php_http_env.c @@ -957,18 +957,10 @@ static SAPI_POST_HANDLER_FUNC(php_http_json_post_handler) ZVAL_NULL(&tmp); php_json_decode(&tmp, json->val, json->len, 1, PG(max_input_nesting_level)); - switch (Z_TYPE(tmp)) { - case IS_NULL: - break; - - case IS_ARRAY: + if (Z_TYPE(tmp) == IS_ARRAY) { array_copy(Z_ARRVAL(tmp), Z_ARRVAL_P(zarg)); - zval_ptr_dtor(&tmp); - break; - - default: - ZVAL_COPY_VALUE(zarg, &tmp); } + zval_ptr_dtor(&tmp); } zend_string_release(json); } -- 2.30.2