Bug #74399 [Opn->Ver]: ob_*clean* methods do not respect missing cleanable flag; same for flushing

From: Date: Mon, 10 Apr 2017 08:06:00 +0000
Subject: Bug #74399 [Opn->Ver]: ob_*clean* methods do not respect missing cleanable flag; same for flushing
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208416@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74399&edit=1 ID: 74399 Updated by: requinix@php.net Reported by: krody dot robi at gmail dot com -Summary: ob_*clean* methods do not respect missing cleanable flag +Summary: ob_*clean* methods do not respect missing cleanable flag; same for flushing -Status: Open +Status: Verified Type: Bug Package: Output Control Operating System: Irrelevant -PHP Version: Irrelevant +PHP Version: 7.1.3 Block user comment: N Private report: N New Comment: Goes back to when the flags were introduced in 5.4: https://3v4l.org/G1Eqn Indeed, CLEANABLE only affects ob_clean() and FLUSHABLE only affects ob_flush(). Looks like it would be fairly straightforward to add in. The alternative would be adjusting the docs, but having those functions respect the flags makes sense to me. And in the case of ob_end_clean and ob_end_flush I would expect both the cleanable/flushable and the removable flags to be required. Previous Comments: ------------------------------------------------------------------------ [2017-04-10 06:02:10] krody dot robi at gmail dot com Description: ------------ This is happening in both php 5.6.29 and php 7.1.0 haven't checked any other versions -> that is why I marked it as version irrelevant as it seems to be version independent Test script: --------------- function callback($buffer, $status) { return "callback $buffer"; } ob_start( 'callback', 0, PHP_OUTPUT_HANDLER_FLUSHABLE | PHP_OUTPUT_HANDLER_REMOVABLE); echo 'test'; echo ob_get_clean(); //this should not work as no CLEANABLE flag was set on ob_start //ob_end_clean is ran as well //ob_clean -> failed to delete buffer notice echo "\n".ob_get_level(); Expected result: ---------------- PHP Notice on ob_start not having the correct flags set for action for the following methods ob_clean() ob_get_clean() ob_end_clean() Actual result: -------------- ob_get_clean() - retrieves buffer content, destroys the buffer ob_end_clean() - buffer destroyed ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74399&edit=1

« previous php.bugs (#208416) next »