From 6d9b5632ff090522af6eaf41eedc520125d2a272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=81rti=C5=86=C5=A1=20Jakubovi=C4=8Ds?= Date: Sat, 13 Oct 2018 16:13:08 +0100 Subject: [PATCH] Flush output buffer before run readfile Fix issue regarding additional whitespaces in saved zip files, which result to broken archives. Whitespaces looks like are generated by WHMCS, issue started to appear on WHMCS 7.6.0. --- modules/servers/namecheapssl/namecheapssl.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/servers/namecheapssl/namecheapssl.php b/modules/servers/namecheapssl/namecheapssl.php index bfb8a3d..7732a23 100644 --- a/modules/servers/namecheapssl/namecheapssl.php +++ b/modules/servers/namecheapssl/namecheapssl.php @@ -2720,6 +2720,8 @@ function namecheapssl_download($params){ header('Content-Type: application/zip'); header('Content-Length: ' . filesize($temp_file)); header('Content-Disposition: attachment; filename="' . str_replace('.','_',$commonName) . '.zip"'); + ob_clean(); + flush(); readfile($temp_file); unlink($temp_file); exit();