diff options
author | vlakoff <vlakoff@gmail.com> | 2014-05-19 13:45:02 +0200 |
---|---|---|
committer | vlakoff <vlakoff@gmail.com> | 2014-05-19 13:45:02 +0200 |
commit | 69550c5525efa018fb89ca15e979a7e76608a117 (patch) | |
tree | 68253bceb3ccf87cdbe52722dcf9bd1827be9d7b /system/libraries | |
parent | 5b9251f2a2db19d5e77c52def8f97b2cd6443e3e (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/libraries')
-rw-r--r-- | system/libraries/Email.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 1f2f6a991..011a88c22 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -2234,15 +2234,18 @@ class CI_Email { */ protected function _mime_types($ext = '') { - static $mimes; + static $_mimes; $ext = strtolower($ext); - if ( ! is_array($mimes)) + if (empty($_mimes)) { - $mimes =& get_mimes(); + // references cannot be directly assigned to static variables, so we use an array + $_mimes[0] =& get_mimes(); } + $mimes =& $_mimes[0]; + if (isset($mimes[$ext])) { return is_array($mimes[$ext]) |