diff --git a/extend/base/FileUtil.php b/extend/base/FileUtil.php index da5c5a696..111ffa205 100755 --- a/extend/base/FileUtil.php +++ b/extend/base/FileUtil.php @@ -332,8 +332,11 @@ class FileUtil Header("Content-Disposition: attachment; filename=".$show_name); // 清除前面输出的内容 - ob_clean(); - flush(); + if(ob_get_length() > 0) + { + ob_clean(); + flush(); + } //一次性将数据传输给客户端 //echo fread($file, filesize($file_path)); diff --git a/extend/base/Qrcode.php b/extend/base/Qrcode.php index 05ad420a3..646416a31 100644 --- a/extend/base/Qrcode.php +++ b/extend/base/Qrcode.php @@ -61,7 +61,10 @@ class Qrcode $content = isset($params['content']) ? base64_decode(urldecode(trim($params['content']))) : __MY_URL__; // 生成二维码并输出页面显示 - ob_clean(); + if(ob_get_length() > 0) + { + ob_clean(); + } \QRcode::png($content, false, $level, $point_size, $mr); } diff --git a/extend/base/Verify.php b/extend/base/Verify.php index 559aee8af..38664fef6 100755 --- a/extend/base/Verify.php +++ b/extend/base/Verify.php @@ -125,7 +125,10 @@ class Verify $this->KindofSession(); // 输出图像 - ob_clean(); + if(ob_get_length() > 0) + { + ob_clean(); + } header('Content-Type: image/gif'); imagegif($this->img);