diff options
Diffstat (limited to 'phpBB/download.php')
| -rw-r--r-- | phpBB/download.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/phpBB/download.php b/phpBB/download.php index 382c528db9..f02de8055a 100644 --- a/phpBB/download.php +++ b/phpBB/download.php @@ -12,7 +12,7 @@ * @ignore */ define('IN_PHPBB', true); -$phpbb_root_path = './'; +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); if (isset($_GET['avatar'])) @@ -322,7 +322,20 @@ function send_avatar_to_browser($file) header("Content-Length: $size"); } - readfile($file_path); + if (@readfile($file_path) === false) + { + $fp = @fopen($file_path, 'rb'); + + if ($fp !== false) + { + while (!feof($fp)) + { + echo fread($fp, 8192); + } + fclose($fp); + } + } + flush(); } else @@ -447,6 +460,10 @@ function send_file_to_browser($attachment, $upload_dir, $category) } fclose($fp); } + else + { + @readfile($filename); + } flush(); exit; |
