srchub

srchub Commit Details


Date:2016-05-01 15:44:43 (8 years 7 months ago)
Author:Natalie Adams
Branch:master
Commit:5d37f6fa6c3a11397277cdf36ccac99184ddb1d3
Parents: cc88235d78df053119ca16b4c90ac440df5f2e10
Message:Issue 157: Force download of preview if file is large

Changes:

File differences

indefero/src/IDF/Views/Source.php
211211
212212
213213
214
214
215
216
215217
216218
217219
if ($request_file_info->type != 'tree') {
$info = self::getRequestedFileMimeType($request_file_info,
$commit, $scm);
if (!IDF_FileUtil::isText($info) && !IDF_FileUtil::isImage($info)) {
$previewSizeLimit = Pluf::f("preview_size_limit", 2000000);
if (!IDF_FileUtil::isText($info) && !IDF_FileUtil::isImage($info) ||
(!IDF_FileUtil::isImage($info) && $request_file_info->size >= $previewSizeLimit)) {
$rep = new Pluf_HTTP_Response($scm->getFile($request_file_info),
$info[0]);
$rep->headers['Content-Disposition'] = 'attachment; filename="'.$info[1].'"';

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.06854s using 20 queries.