Fix PHP Notice: ob_end_clean(): failed to delete buffer.

pull/2484/head
jmontoyaa 8 years ago
parent 92b7b6d528
commit 62bb71b463
  1. 4
      main/inc/lib/document.lib.php

@ -327,7 +327,7 @@ class DocumentManager
header('Content-Description: '.$filename); header('Content-Description: '.$filename);
header('Content-Transfer-Encoding: binary'); header('Content-Transfer-Encoding: binary');
if (function_exists('ob_end_clean')) { if (function_exists('ob_end_clean') && ob_get_length()) {
// Use ob_end_clean() to avoid weird buffering situations // Use ob_end_clean() to avoid weird buffering situations
// where file is sent broken/incomplete for download // where file is sent broken/incomplete for download
ob_end_clean(); ob_end_clean();
@ -393,7 +393,7 @@ class DocumentManager
); );
echo $content; echo $content;
} else { } else {
if (function_exists('ob_end_clean')) { if (function_exists('ob_end_clean') && ob_get_length()) {
// Use ob_end_clean() to avoid weird buffering situations // Use ob_end_clean() to avoid weird buffering situations
// where file is sent broken/incomplete for download // where file is sent broken/incomplete for download
ob_end_clean(); ob_end_clean();

Loading…
Cancel
Save