修订版 | e2c88ccc8992a50fef131dfc5fb62f95e7978e51 (tree) |
---|---|
时间 | 2017-08-23 06:02:56 |
作者 | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2102 Disable output buffering on sending an file
@@ -2,7 +2,7 @@ | ||
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | 3 | // attach.inc.php |
4 | 4 | // Copyright |
5 | -// 2003-2016 PukiWiki Development Team | |
5 | +// 2003-2017 PukiWiki Development Team | |
6 | 6 | // 2002-2003 PANDA <panda@arino.jp> http://home.arino.jp/ |
7 | 7 | // 2002 Y.MASUI <masui@hisec.co.jp> http://masui.net/pukiwiki/ |
8 | 8 | // 2001-2002 Originally written by yu-ji |
@@ -746,7 +746,11 @@ EOD; | ||
746 | 746 | . '"; filename*=utf-8\'\'' . rawurlencode($utf8filename)); |
747 | 747 | header('Content-Length: ' . $this->size); |
748 | 748 | header('Content-Type: ' . $this->type); |
749 | - | |
749 | + // Disable output bufferring | |
750 | + while (ob_get_level()) { | |
751 | + ob_end_flush(); | |
752 | + } | |
753 | + flush(); | |
750 | 754 | @readfile($this->filename); |
751 | 755 | exit; |
752 | 756 | } |
@@ -2,7 +2,7 @@ | ||
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | 3 | // dump.inc.php |
4 | 4 | // Copyright |
5 | -// 2004-2016 PukiWiki Development Team | |
5 | +// 2004-2017 PukiWiki Development Team | |
6 | 6 | // 2004 teanan / Interfair Laboratory |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -204,6 +204,11 @@ function download_tarfile($tempnam, $arc_kind) | ||
204 | 204 | header('Content-Length: ' . $size); |
205 | 205 | header('Content-Type: application/octet-stream'); |
206 | 206 | header('Pragma: no-cache'); |
207 | + // Disable output bufferring | |
208 | + while (ob_get_level()) { | |
209 | + ob_end_flush(); | |
210 | + } | |
211 | + flush(); | |
207 | 212 | @readfile($tempnam); |
208 | 213 | } |
209 | 214 |
@@ -1,8 +1,8 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | -// $Id: ref.inc.php,v 1.51 2011/01/25 15:01:01 henoheno Exp $ | |
4 | -// Copyright (C) | |
5 | -// 2002-2006 PukiWiki Developers Team | |
3 | +// ref.inc.php | |
4 | +// Copyright | |
5 | +// 2002-2017 PukiWiki Development Team | |
6 | 6 | // 2001-2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -430,6 +430,11 @@ function plugin_ref_action() | ||
430 | 430 | .'"; filename*=utf-8\'\'' . rawurlencode($utf8filename)); |
431 | 431 | header('Content-Length: ' . $size); |
432 | 432 | header('Content-Type: ' . $type); |
433 | + // Disable output bufferring | |
434 | + while (ob_get_level()) { | |
435 | + ob_end_flush(); | |
436 | + } | |
437 | + flush(); | |
433 | 438 | @readfile($ref); |
434 | 439 | exit; |
435 | 440 | } |