Swat/SwatFileEntry.php
protected function hasValidMimeType()
    {
        $valid = false;

        if ($this->isUploaded()) {
            // Some container formats can contain return multiple mime-types.
            // If any of the contained types are valid, we consider the file
            // valid.
            $mime_types = explode(' ', $this->getMimeType());
            if (
                is_array($this->accept_mime_types) &&
                count($this->accept_mime_types) > 0
            ) {
                $types = array_intersect($mime_types, $this->accept_mime_types);
                $valid = count($types) > 0;
            } else {
                $valid = true;
            }
        }

        return $valid;
    }
protected function hasValidMimeType()
    {
        $valid = false;

        if ($this->isUploaded()) {
            // Some container formats can contain return multiple mime-types.
            // If any of the contained types are valid, we consider the file
            // valid.
            $mime_types = explode(' ', $this->getMimeType());
            if (
                is_array($this->accept_mime_types) &&
                count($this->accept_mime_types) > 0
            ) {
                $types = array_intersect($mime_types, $this->accept_mime_types);
                $valid = count($types) > 0;
            } else {
                $valid = true;
            }
        }

        return $valid;
    }
protected function hasValidMimeType ( ) { $ valid = false ; if ( $ this -> isUploaded ( ) ) { // Some container formats can contain return multiple mime-types. // If any of the contained types are valid, we consider the file // valid. $ mime_types = explode ( ' ' , $ this -> getMimeType ( ) ) ; if ( is_array ( $ this -> accept_mime_types ) && count ( $ this -> accept_mime_types ) > 0 ) { $ types = array_intersect ( $ mime_types , $ this -> accept_mime_types ) ; $ valid = count ( $ types ) > 0 ; } else { $ valid = true ; } } return $ valid ; }
Whether or not the uploaded file's mime type is valid

Gets whether or not the upload file's mime type matches the accepted
mime types of this widget. Valid mime types for this widget are stored in
the {@link SwatFileEntry::$accept_mime_types} array. If the
<kbd>$accept_mime_types</kbd> array is empty, the uploaded file's mime
type is always valid.

Some container formats may have multiple mime-types. In this case, if
any of the contained types are valid, we consider the file valid.

@return boolean whether or not this file's mime type is valid.
Whether or not the uploaded file s mime type is valid