Skip to content
Snippets Groups Projects
Commit 0c722a3a authored by aydreeihn's avatar aydreeihn
Browse files

Only allow image attachments to be opened in the browser window #3920

parent dc5f1596
No related branches found
No related tags found
No related merge requests found
...@@ -106,7 +106,7 @@ class Http { ...@@ -106,7 +106,7 @@ class Http {
} }
function download($filename, $type, $data=null, $disposition='attachment') { 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'; $disposition='attachment';
header('Pragma: private'); header('Pragma: private');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment