From 0149ba3e76515721b2681d0c57f8652bed2a27f6 Mon Sep 17 00:00:00 2001 From: devil Date: Sat, 15 Feb 2020 21:24:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E9=99=A4=E7=BC=93=E5=AD=98=E5=8C=BA?= =?UTF-8?q?=20bug=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/base/FileUtil.php | 7 +++++-- extend/base/Qrcode.php | 5 ++++- extend/base/Verify.php | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) 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);