From a63a5db93967c9d9ce9f7b0d76d9034b0fc809c8 Mon Sep 17 00:00:00 2001 From: Andrii Bilyi Date: Wed, 24 May 2017 11:23:45 +0300 Subject: [PATCH] Error if no buffer --- src/PHPStamp/Result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PHPStamp/Result.php b/src/PHPStamp/Result.php index 8853223..5588d1b 100644 --- a/src/PHPStamp/Result.php +++ b/src/PHPStamp/Result.php @@ -39,7 +39,7 @@ public function download($fileName = null) header('Content-Disposition: attachment;filename="' . $fileName . '"'); // Send file - required ob_clean() & exit; - ob_clean(); + if (ob_get_contents()) ob_clean(); readfile($tempArchive); unlink($tempArchive); exit;