Skip to content

Commit 66c7bb4

Browse files
committed
Remove static cache in Email->_mimes_types()
Saving one function call isn't worth the code overhead.
1 parent 69550c5 commit 66c7bb4

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

system/libraries/Email.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,17 +2234,9 @@ protected function _set_error_message($msg, $val = '')
22342234
*/
22352235
protected function _mime_types($ext = '')
22362236
{
2237-
static $_mimes;
2238-
22392237
$ext = strtolower($ext);
22402238

2241-
if (empty($_mimes))
2242-
{
2243-
// references cannot be directly assigned to static variables, so we use an array
2244-
$_mimes[0] =& get_mimes();
2245-
}
2246-
2247-
$mimes =& $_mimes[0];
2239+
$mimes =& get_mimes();
22482240

22492241
if (isset($mimes[$ext]))
22502242
{

0 commit comments

Comments
 (0)