From f9dd83caa72a799916725888a631725d532d780e Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 1 Mar 2010 19:56:16 -0500 Subject: [PATCH] Modify configuration to have an option to allow uploads regardless of mime type --- config.php.sample | 2 ++ lib/mediafile.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config.php.sample b/config.php.sample index b8852dc672..5c5fb5b539 100644 --- a/config.php.sample +++ b/config.php.sample @@ -275,6 +275,8 @@ $config['sphinx']['port'] = 3312; // Support for file uploads (attachments), // select supported mimetypes and quotas (in bytes) // $config['attachments']['supported'] = array('image/png', 'application/ogg'); +// $config['attachments']['supported'] = true; //allow all file types to be uploaded + // $config['attachments']['file_quota'] = 5000000; // $config['attachments']['user_quota'] = 50000000; // $config['attachments']['monthly_quota'] = 15000000; diff --git a/lib/mediafile.php b/lib/mediafile.php index e3d5b1dbcc..10d90d0081 100644 --- a/lib/mediafile.php +++ b/lib/mediafile.php @@ -262,7 +262,7 @@ class MediaFile $filetype = MIME_Type::autoDetect($stream['uri']); } - if (in_array($filetype, common_config('attachments', 'supported'))) { + if (common_config('attachments', 'supported') === true || in_array($filetype, common_config('attachments', 'supported'))) { return $filetype; } $media = MIME_Type::getMedia($filetype); -- 2.39.5