From 0c722a3ab7c7655b9946bbe9a782fb0e36ef96ab Mon Sep 17 00:00:00 2001
From: aydreeihn <adriane@enhancesoft.com>
Date: Thu, 8 Mar 2018 15:08:37 -0600
Subject: [PATCH] Only allow image attachments to be opened in the browser
 window #3920

---
 include/class.http.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/class.http.php b/include/class.http.php
index 632a80b03..b8205f5c9 100644
--- a/include/class.http.php
+++ b/include/class.http.php
@@ -106,7 +106,7 @@ class Http {
     }
 
     function download($filename, $type, $data=null, $disposition='attachment') {
-        if (strpos($type, 'image/') !== 0 || preg_match('/image\/.*\+.*/', $type))
+        if (strpos($type, 'image/') !== false && preg_match('/image\/.*\+.*/', $type))
           $disposition='attachment';
 
         header('Pragma: private');
-- 
GitLab