summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorvlakoff <vlakoff@gmail.com>2014-05-19 13:45:02 +0200
committervlakoff <vlakoff@gmail.com>2014-05-19 13:45:02 +0200
commit69550c5525efa018fb89ca15e979a7e76608a117 (patch)
tree68253bceb3ccf87cdbe52722dcf9bd1827be9d7b /system/core
parent5b9251f2a2db19d5e77c52def8f97b2cd6443e3e (diff)
Fix caching of MIME config
* in get_mimes(): was missing isset() test * in Email->_mimes_types(): static cache of reference was noneffective refs 6ef498b49946ba74d610b3805fb908b163a7f03a
Diffstat (limited to 'system/core')
-rw-r--r--system/core/Common.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/system/core/Common.php b/system/core/Common.php
index 7f2708151..752a2e7f1 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -304,15 +304,22 @@ if ( ! function_exists('get_mimes'))
*/
function &get_mimes()
{
- static $_mimes = array();
+ static $_mimes;
- if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
+ if (empty($_mimes))
{
- $_mimes = include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
- }
- elseif (file_exists(APPPATH.'config/mimes.php'))
- {
- $_mimes = include(APPPATH.'config/mimes.php');
+ if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
+ {
+ $_mimes = include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
+ }
+ elseif (file_exists(APPPATH.'config/mimes.php'))
+ {
+ $_mimes = include(APPPATH.'config/mimes.php');
+ }
+ else
+ {
+ $_mimes = array();
+ }
}
return $_mimes;