mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
- Added whitelist site setting for allowed file extensions to upload via media module.
- Hardcoded blacklist: web.config - Superuser immune to whitelist restriction - Zip files still allowed even if not in the list since these are expanded by the media module to allow for multi upload. - Files within a zip must still pass white/black-list test per normal rules (file is skipped if not). --HG-- branch : dev
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
using System.Net.Mail;
|
||||
using Orchard.ContentManagement.Records;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Orchard.Media.Models {
|
||||
public class MediaSettingsPartRecord : ContentPartRecord {
|
||||
internal const string DefaultWhitelist = "jpg jpeg gif png txt doc docx xls xlsx pdf ppt pptx pps ppsx odt ods odp";
|
||||
private string _whitelist = DefaultWhitelist;
|
||||
|
||||
public virtual string UploadAllowedFileTypeWhitelist {
|
||||
get { return _whitelist; }
|
||||
set { _whitelist = value; }
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user