CodeIgniter icon indicating copy to clipboard operation
CodeIgniter copied to clipboard

Bug in Common.php get_mimes function

Open pro85 opened this issue 14 years ago • 3 comments

This function always return 1. The code must be:

function &get_mimes() { static $_mimes = array();
    if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
    {
        include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
        $_mimes = $mimes;
    }
    elseif (is_file(APPPATH.'config/mimes.php'))
    {
        include(APPPATH.'config/mimes.php');
        $_mimes = $mimes;
    }
    return $_mimes;
}

pro85 avatar Oct 12 '12 19:10 pro85

@pro85 This needs to be a pull request as this doesn't reference out the previous function so that I can view the difference from the current to the one you're requesting to be changed to.

ckdarby avatar Oct 12 '12 19:10 ckdarby

There's nothing wrong with it. Newest version of application/config/mimes.php directly returns an array instead of defining it by name.

narfbg avatar Oct 12 '12 21:10 narfbg

You right i don't update config file with changes.

pro85 avatar Oct 12 '12 21:10 pro85