SVG images are displayed as plain text

Added by Andrei Galea 4 months ago

I recently upgraded our Redmine from 3.4 to 4.0. After this upgrade SVG Images are displayed as plain text when accessing the attachment link.
I tried to add the mime_type 'image/svg+xml'=> 'svg' in lib/redmine/mime_type.rb without any results.
Trying to reproduce this issue i added some logging output to the attachments_confroller.rb:

PNG or JPG Files:

attachment.is_text: false
attachment.is_image: true

SVG Files:

attachment.is_text: true
attachment.is_image: true

Since is_image is after is_text (elsif) the SVG is rendered as text. (

Does anyone has any ideas how to solve this issue?