From: Pierrick Charron Date: Fri, 18 Nov 2011 00:16:58 +0000 (+0000) Subject: Fixed bug #60321 (ob_get_status(true) no longer returns an array when buffer is empty). X-Git-Tag: php-5.4.0RC2~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e2dcfd8b603e452781269158b735c12965e97fb;p=php Fixed bug #60321 (ob_get_status(true) no longer returns an array when buffer is empty). --- diff --git a/NEWS b/NEWS index 74d1ce1c72..717cb7137d 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,8 @@ PHP NEWS (Chris Jones) - Output: + . Fixed bug #60321 (ob_get_status(true) no longer returns an array when + buffer is empty). (Pierrick) . Fixed bug #60282 (Segfault when using ob_gzhandler() with open buffers). (Laruence) diff --git a/main/output.c b/main/output.c index 6a8f79a727..3b06d7471a 100644 --- a/main/output.c +++ b/main/output.c @@ -1439,12 +1439,12 @@ PHP_FUNCTION(ob_get_status) return; } + array_init(return_value); + if (!OG(active)) { - RETURN_FALSE; + return; } - array_init(return_value); - if (full_status) { zend_stack_apply_with_argument(&OG(handlers), ZEND_STACK_APPLY_BOTTOMUP, php_output_stack_apply_status, return_value); } else { diff --git a/tests/output/bug60321.phpt b/tests/output/bug60321.phpt new file mode 100644 index 0000000000..9802a57ccd --- /dev/null +++ b/tests/output/bug60321.phpt @@ -0,0 +1,9 @@ +--TEST-- +Bug #60321 (ob_get_status(true) no longer returns an array when buffer is empty) +--FILE-- +