Bug #69404 [NEW]: ob_get_flush() and ob_end_flush() do not check PHP_OUTPUT_HANDLER_FLUSHABLE

From: Date: Thu, 09 Apr 2015 06:44:34 +0000
Subject: Bug #69404 [NEW]: ob_get_flush() and ob_end_flush() do not check PHP_OUTPUT_HANDLER_FLUSHABLE
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191913@lists.php.net to get a copy of this message
From:             tstarling
Operating system: Any
PHP version:      5.5Git-2015-04-09 (Git)
Package:          Output Control
Bug Type:         Bug
Bug description:ob_get_flush() and ob_end_flush() do not check PHP_OUTPUT_HANDLER_FLUSHABLE

Description:
------------
According to the manual, ob_get_flush() and ob_end_flush() should fail
if PHP_OUTPUT_HANDLER_FLUSHABLE was not given during ob_start(). That
seems like a sensible policy, but the flag is only checked during
ob_flush().

I noticed this bug while reading output.c, I don't actually use those
functions.

Test script:
---------------
<?php
ob_start(null, 0, PHP_OUTPUT_HANDLER_REMOVABLE);
print "x\n";
var_dump(ob_get_flush());


Expected result:
----------------
PHP Notice:  ob_get_flush(): failed to flush buffer of default output
handler (0) in ob_get_flush.php on line 4
bool(false)
x

Actual result:
--------------
x
string(2) "x
"


-- 
Edit bug report at https://bugs.php.net/bug.php?id=69404&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=69404&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=69404&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=69404&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=69404&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=69404&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=69404&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=69404&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=69404&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=69404&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=69404&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=69404&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=69404&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=69404&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69404&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=69404&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=69404&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=69404&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69404&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=69404&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=69404&r=mysqlcfg



Thread (1 message)

  • tstarling@php.net
« previous php.bugs (#191913) next »