diff options
Diffstat (limited to 'system')
-rwxr-xr-x | system/core/Output.php | 6 | ||||
-rw-r--r-- | system/helpers/download_helper.php | 4 | ||||
-rw-r--r-- | system/helpers/file_helper.php | 6 | ||||
-rw-r--r-- | system/libraries/Upload.php | 6 |
4 files changed, 9 insertions, 13 deletions
diff --git a/system/core/Output.php b/system/core/Output.php index 9b85b3ec4..a9e77cc5f 100755 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -106,15 +106,13 @@ class CI_Output { // Get mime types for later if (defined('ENVIRONMENT') && file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) { - include APPPATH.'config/'.ENVIRONMENT.'/mimes.php'; + $this->mime_types = include APPPATH.'config/'.ENVIRONMENT.'/mimes.php'; } else { - include APPPATH.'config/mimes.php'; + $this->mime_types = include APPPATH.'config/mimes.php'; } - - $this->mime_types = $mimes; log_message('debug', 'Output Class Initialized'); } diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 9c390a7f7..3c677055f 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -75,11 +75,11 @@ if ( ! function_exists('force_download')) // 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 diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 0061c4285..068706c30 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -349,17 +349,17 @@ if ( ! function_exists('get_mime_by_extension')) { $extension = strtolower(substr(strrchr($file, '.'), 1)); - global $mimes; + static $mimes; if ( ! is_array($mimes)) { 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'); } if ( ! is_array($mimes)) 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; |