elFinder\elFinderVolumeDriver::mimeAccepted PHP Method

mimeAccepted() public method

Return true if mime is required mimes list
Author: Dmitry (dio) Levashov
Author: Troex Nevelin
public mimeAccepted ( string $mime, array $mimes = [], boolean | null $empty = true ) : boolean | null
$mime string mime type to check
$mimes array allowed mime types list or not set to use client mimes list
$empty boolean | null what to return on empty list
return boolean | null
    public function mimeAccepted($mime, $mimes = array(), $empty = true)
    {
        $mimes = !empty($mimes) ? $mimes : $this->onlyMimes;
        if (empty($mimes)) {
            return $empty;
        }
        return $mime == 'directory' || in_array('all', $mimes) || in_array('All', $mimes) || in_array($mime, $mimes) || in_array(substr($mime, 0, strpos($mime, '/')), $mimes);
    }