mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#20399: white-listing supported image types, which allows for previously unsupported types like svg to be handled by the document factory instead of causing the image factory to throw.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement;
|
||||
@@ -22,6 +23,9 @@ namespace Orchard.MediaLibrary.Factories {
|
||||
if (!mimeType.StartsWith("image/")) {
|
||||
return null;
|
||||
}
|
||||
if (!ImageCodecInfo.GetImageDecoders().Select(d => d.MimeType).Contains(mimeType)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!String.IsNullOrEmpty(contentType)) {
|
||||
var contentDefinition = _contentDefinitionManager.GetTypeDefinition(contentType);
|
||||
|
Reference in New Issue
Block a user