From 0a15874ea1874a59233f3d4b4df882e2f8cadf4a Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 1 May 2016 15:58:22 -0500 Subject: [PATCH] Issue 158: Previewing a file using a SCM that does not have file info throws exception --- indefero/src/IDF/Views/Source.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indefero/src/IDF/Views/Source.php b/indefero/src/IDF/Views/Source.php index 6c1a5a4..1d48566 100644 --- a/indefero/src/IDF/Views/Source.php +++ b/indefero/src/IDF/Views/Source.php @@ -213,7 +213,7 @@ class IDF_Views_Source $commit, $scm); $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)) { + (!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), $info[0]); $rep->headers['Content-Disposition'] = 'attachment; filename="'.$info[1].'"';