Issue 158: Previewing a file using a SCM that does not have file info throws exception
This commit is contained in:
parent
5d37f6fa6c
commit
0a15874ea1
@ -213,7 +213,7 @@ class IDF_Views_Source
|
|||||||
$commit, $scm);
|
$commit, $scm);
|
||||||
$previewSizeLimit = Pluf::f("preview_size_limit", 2000000);
|
$previewSizeLimit = Pluf::f("preview_size_limit", 2000000);
|
||||||
if (!IDF_FileUtil::isText($info) && !IDF_FileUtil::isImage($info) ||
|
if (!IDF_FileUtil::isText($info) && !IDF_FileUtil::isImage($info) ||
|
||||||
(!IDF_FileUtil::isImage($info) && $request_file_info->size >= $previewSizeLimit)) {
|
(!IDF_FileUtil::isImage($info) && property_exists($request_file_info, "size") && $request_file_info->size >= $previewSizeLimit)) {
|
||||||
$rep = new Pluf_HTTP_Response($scm->getFile($request_file_info),
|
$rep = new Pluf_HTTP_Response($scm->getFile($request_file_info),
|
||||||
$info[0]);
|
$info[0]);
|
||||||
$rep->headers['Content-Disposition'] = 'attachment; filename="'.$info[1].'"';
|
$rep->headers['Content-Disposition'] = 'attachment; filename="'.$info[1].'"';
|
||||||
|
Loading…
Reference in New Issue
Block a user