Skip to content

Commit

Permalink
Fixed bug #60321 (ob_get_status(true) no longer returns an array when…
Browse files Browse the repository at this point in the history
… buffer is empty).
  • Loading branch information
adoy committed Nov 18, 2011
1 parent 2ba9ff7 commit 52ca904
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,13 +1438,13 @@ PHP_FUNCTION(ob_get_status)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &full_status) == FAILURE) {
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 {
Expand Down
9 changes: 9 additions & 0 deletions tests/output/bug60321.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--TEST--
Bug #60321 (ob_get_status(true) no longer returns an array when buffer is empty)
--FILE--
<?php
$return = ob_get_status(true);
var_dump($return);
--EXPECT--
array(0) {
}

0 comments on commit 52ca904

Please sign in to comment.