php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #17923 needing ob_end_clean_all();
Submitted: 2002-06-22 11:20 UTC Modified: 2002-06-22 11:35 UTC
From: tit dot petric at telemach dot net Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.2.0 OS: linux/all
Private report: No CVE-ID: None
 [2002-06-22 11:20 UTC] tit dot petric at telemach dot net
in case we use ob_start() on multiple times, we have more output buffers (more levels of them), and we sometimes dont know of how many to dispose (in case of errors)

p.s. i think ob_end_clean() doesnt really "clean" the data collected on 4.2, and i think i spotted this somewhere else..

function condor_error($errno, $errstr, $errfile, $errline)
{
        $errors = array(E_USER_ERROR, E_ERROR, E_PARSE);
        if (in_array($errno,$errors)) {
                //      ob_end_clean();
                //      ob_end_clean();
                //      ob_end_clean();
                echo "<B>FATAL</B> [".$errno."] ".$errstr."<br>\n";
                echo "Fatal error at line ".$errline." of file ".$errfile;
                echo ", PHP ".PHP_VERSION." (".PHP_OS.")<br>\n";
                echo "Aborting...<br><br>\n\n";
                exit;
        }
}

set_error_handler("condor_error");


replace the //ob_end_clean() with ob_end_clean_all();

if its bogus, then i apologise for wasting your time :)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-22 11:23 UTC] tit dot petric at telemach dot net
i was wrong on the _clean not cleaning the data, i just re-tested it... ob_end_clean_all() would still be fine.
 [2002-06-22 11:35 UTC] sander@php.net
You can very easily do this using ob_get_level(). Don't think it's really needed.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Jun 18 16:00:01 2026 UTC