From 0a8abd087ad21f730fa9704af3e30a179b7ae467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Fri, 22 Feb 2013 10:47:00 +0100 Subject: [PATCH] [-] BO: Fix PHP notice on ob_clean if no buffer to delete --- classes/controller/AdminController.php | 3 ++- classes/pdf/PDF.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 3a49dd35b..a04323983 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -570,7 +570,8 @@ class AdminControllerCore extends Controller public function processExport() { // clean buffer - ob_clean(); + if (ob_get_level() && ob_get_length() > 0) + ob_clean(); $this->getList($this->context->language->id); if (!count($this->_list)) return; diff --git a/classes/pdf/PDF.php b/classes/pdf/PDF.php index b348a67c8..325d1909c 100755 --- a/classes/pdf/PDF.php +++ b/classes/pdf/PDF.php @@ -81,8 +81,9 @@ class PDFCore if ($render) { - // clean the output buffer to avoid random bugs with tcpdf - @ob_end_clean(); //if you change zlib output compression setting in between ob_start and ob_end_clean or ob_end_flush, you will get an error + // clean the output buffer + if (ob_get_level() && ob_get_length() > 0) + ob_clean(); return $this->pdf_renderer->render($this->filename, $display); } }