CI_Upload::_prep_filename PHP Method

_prep_filename() protected method

Prevents possible script execution from Apache's handling of files' multiple extensions.
protected _prep_filename ( string $filename ) : string
$filename string
return string
    protected function _prep_filename($filename)
    {
        if ($this->mod_mime_fix === FALSE or $this->allowed_types === '*' or ($ext_pos = strrpos($filename, '.')) === FALSE) {
            return $filename;
        }
        $ext = substr($filename, $ext_pos);
        $filename = substr($filename, 0, $ext_pos);
        return str_replace('.', '_', $filename) . $ext;
    }