summaryrefslogtreecommitdiffstats
path: root/system/libraries/Upload.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-06-04 23:51:14 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-06-04 23:51:14 +0200
commit39b1c11f5976104dce30fe83e1d3c6f9ed616122 (patch)
tree482b07468ca201d0dbdbfcf3cdb121c967003112 /system/libraries/Upload.php
parent10d78f61399dd647ada0afaa43e5e9ec48d55e82 (diff)
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.
Diffstat (limited to 'system/libraries/Upload.php')
-rw-r--r--system/libraries/Upload.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index bd97a611b..e31029e49 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -930,18 +930,16 @@ class CI_Upload {
{
if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
{
- include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
+ $this->mimes = include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
}
elseif (is_file(APPPATH.'config/mimes.php'))
{
- include(APPPATH.'config/mimes.php');
+ $this->mimes = include(APPPATH.'config/mimes.php');
}
else
{
return FALSE;
}
-
- $this->mimes = $mimes;
}
return isset($this->mimes[$mime]) ? $this->mimes[$mime] : FALSE;