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 8923186..097bdba 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) {