Direct return from mimes config, instead of using global $mimes;
Global variables are generally a terrible idea, especially for something as simple as this. The mimes.php now returns an array instead of just injecting a variable name into the global namespace.
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php
index 9c390a7..3c67705 100644
--- a/system/helpers/download_helper.php
+++ b/system/helpers/download_helper.php
@@ -75,11 +75,11 @@
// Load the mime types
if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
{
- include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
+ $mimes = include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
}
elseif (is_file(APPPATH.'config/mimes.php'))
{
- include(APPPATH.'config/mimes.php');
+ $mimes = include(APPPATH.'config/mimes.php');
}
// Only change the default MIME if we can find one