Possible fix for 'ob_end_clean: failed to delete buffer. No buffer to delete.'
authorRoland Häder <roland@mxchange.org>
Sat, 26 Jun 2010 16:41:12 +0000 (16:41 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 26 Jun 2010 16:41:12 +0000 (16:41 +0000)
inc/wrapper-functions.php

index ff399cb..a6f0828 100644 (file)
@@ -117,7 +117,7 @@ function writeToFile ($FQFN, $content, $aquireLock = false) {
 // Clears the output buffer. This function does *NOT* backup sent content.
 function clearOutputBuffer () {
        // Trigger an error on failure
-       if (!ob_end_clean()) {
+       if ((ob_get_length() > 0) && (!ob_end_clean())) {
                // Failed!
                debug_report_bug(__FUNCTION__.': Failed to clean output buffer.');
        } // END - if