]> granicus.if.org Git - php/commitdiff
Fixed bug #60321 (ob_get_status(true) no longer returns an array when buffer is empty).
authorPierrick Charron <pierrick@php.net>
Fri, 18 Nov 2011 00:16:58 +0000 (00:16 +0000)
committerPierrick Charron <pierrick@php.net>
Fri, 18 Nov 2011 00:16:58 +0000 (00:16 +0000)
NEWS
main/output.c
tests/output/bug60321.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 74d1ce1c728a0dbfa4b3017407c059cff550c4e9..717cb7137d8346de9236c43a220554a7950db605 100644 (file)
--- 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)
     
index 6a8f79a727413bfa283c4ffa4cdeea4aee2ebc0e..3b06d7471a917696098ff8141a8b607d069d5d6e 100644 (file)
@@ -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 (file)
index 0000000..9802a57
--- /dev/null
@@ -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) {
+}