backport check
authorMichael Wallner <mike@php.net>
Tue, 16 Jun 2015 10:24:48 +0000 (12:24 +0200)
committerMichael Wallner <mike@php.net>
Tue, 16 Jun 2015 10:24:48 +0000 (12:24 +0200)
php_http_env_response.c

index 892318657b9ea7a0dcf95b47abb931c1b6b1e8d3..097bdba7217845025377f3cbad8b1186563bb19e 100644 (file)
@@ -1213,8 +1213,9 @@ static PHP_METHOD(HttpEnvResponse, __invoke)
 
                PHP_HTTP_ENV_RESPONSE_OBJECT_INIT(obj);
 
-               php_http_message_object_init_body_object(obj);
-
+               if (!obj->body) {
+                       php_http_message_object_init_body_object(obj);
+               }
                php_http_message_body_append(obj->message->body, ob_str, ob_len);
 #if PHP_VERSION_ID >= 50400
                if (ob_flags & PHP_OUTPUT_HANDLER_CLEAN) {