Bug #74399 [NEW]: ob_*clean* methods do not respect missing cleanable flag
| From: | krody dot robi at gmail dot com | Date: | Mon, 10 Apr 2017 06:02:14 +0000 |
| Subject: | Bug #74399 [NEW]: ob_*clean* methods do not respect missing cleanable flag | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-208413@lists.php.net to get a copy of this message | ||
From: krody dot robi at gmail dot com
Operating system: Irrelevant
PHP version: Irrelevant
Package: Output Control
Bug Type: Bug
Bug description:ob_*clean* methods do not respect missing cleanable flag
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 bug report at https://bugs.php.net/bug.php?id=74399&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74399&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74399&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74399&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74399&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74399&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74399&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74399&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74399&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74399&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74399&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74399&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74399&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74399&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74399&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74399&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74399&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74399&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74399&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74399&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74399&r=mysqlcfg