2
0
forked from Wavyzz/dolibarr

Merge pull request #27339 from mdeweerd/optim/dol_mimetype

Perf: Optimise dol_mimetype
This commit is contained in:
Laurent Destailleur
2024-01-10 15:05:01 +01:00
committed by GitHub

View File

@@ -10870,373 +10870,325 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0)
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.rtx$/i', $tmpfile)) {
if (preg_match('/\.rtx$/i', $tmpfile)) {
$mime = 'text/richtext'; $mime = 'text/richtext';
$imgmime = 'text.png'; $imgmime = 'text.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.csv$/i', $tmpfile)) {
if (preg_match('/\.csv$/i', $tmpfile)) {
$mime = 'text/csv'; $mime = 'text/csv';
$imgmime = 'text.png'; $imgmime = 'text.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.tsv$/i', $tmpfile)) {
if (preg_match('/\.tsv$/i', $tmpfile)) {
$mime = 'text/tab-separated-values'; $mime = 'text/tab-separated-values';
$imgmime = 'text.png'; $imgmime = 'text.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.(cf|conf|log)$/i', $tmpfile)) {
if (preg_match('/\.(cf|conf|log)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.ini$/i', $tmpfile)) {
if (preg_match('/\.ini$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'ini'; $srclang = 'ini';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.md$/i', $tmpfile)) {
if (preg_match('/\.md$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'md'; $srclang = 'md';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.css$/i', $tmpfile)) {
if (preg_match('/\.css$/i', $tmpfile)) {
$mime = 'text/css'; $mime = 'text/css';
$imgmime = 'css.png'; $imgmime = 'css.png';
$srclang = 'css'; $srclang = 'css';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.lang$/i', $tmpfile)) {
if (preg_match('/\.lang$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'lang'; $srclang = 'lang';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } // phpcs:ignore
// Certificate files // Certificate files
if (preg_match('/\.(crt|cer|key|pub)$/i', $tmpfile)) { elseif (preg_match('/\.(crt|cer|key|pub)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } // phpcs:ignore
// XML based (HTML/XML/XAML) // XML based (HTML/XML/XAML)
if (preg_match('/\.(html|htm|shtml)$/i', $tmpfile)) { elseif (preg_match('/\.(html|htm|shtml)$/i', $tmpfile)) {
$mime = 'text/html'; $mime = 'text/html';
$imgmime = 'html.png'; $imgmime = 'html.png';
$srclang = 'html'; $srclang = 'html';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.(xml|xhtml)$/i', $tmpfile)) {
if (preg_match('/\.(xml|xhtml)$/i', $tmpfile)) {
$mime = 'text/xml'; $mime = 'text/xml';
$imgmime = 'other.png'; $imgmime = 'other.png';
$srclang = 'xml'; $srclang = 'xml';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.xaml$/i', $tmpfile)) {
if (preg_match('/\.xaml$/i', $tmpfile)) {
$mime = 'text/xml'; $mime = 'text/xml';
$imgmime = 'other.png'; $imgmime = 'other.png';
$srclang = 'xaml'; $srclang = 'xaml';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } // phpcs:ignore
// Languages // Languages
if (preg_match('/\.bas$/i', $tmpfile)) { elseif (preg_match('/\.bas$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'bas'; $srclang = 'bas';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.(c)$/i', $tmpfile)) {
if (preg_match('/\.(c)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'c'; $srclang = 'c';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.(cpp)$/i', $tmpfile)) {
if (preg_match('/\.(cpp)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'cpp'; $srclang = 'cpp';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.cs$/i', $tmpfile)) {
if (preg_match('/\.cs$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'cs'; $srclang = 'cs';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.(h)$/i', $tmpfile)) {
if (preg_match('/\.(h)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'h'; $srclang = 'h';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.(java|jsp)$/i', $tmpfile)) {
if (preg_match('/\.(java|jsp)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'java'; $srclang = 'java';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.php([0-9]{1})?$/i', $tmpfile)) {
if (preg_match('/\.php([0-9]{1})?$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'php.png'; $imgmime = 'php.png';
$srclang = 'php'; $srclang = 'php';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.phtml$/i', $tmpfile)) {
if (preg_match('/\.phtml$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'php.png'; $imgmime = 'php.png';
$srclang = 'php'; $srclang = 'php';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.(pl|pm)$/i', $tmpfile)) {
if (preg_match('/\.(pl|pm)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'pl.png'; $imgmime = 'pl.png';
$srclang = 'perl'; $srclang = 'perl';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.sql$/i', $tmpfile)) {
if (preg_match('/\.sql$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'sql'; $srclang = 'sql';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.js$/i', $tmpfile)) {
if (preg_match('/\.js$/i', $tmpfile)) {
$mime = 'text/x-javascript'; $mime = 'text/x-javascript';
$imgmime = 'jscript.png'; $imgmime = 'jscript.png';
$srclang = 'js'; $srclang = 'js';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } // phpcs:ignore
// Open office // Open office
if (preg_match('/\.odp$/i', $tmpfile)) { elseif (preg_match('/\.odp$/i', $tmpfile)) {
$mime = 'application/vnd.oasis.opendocument.presentation'; $mime = 'application/vnd.oasis.opendocument.presentation';
$imgmime = 'ooffice.png'; $imgmime = 'ooffice.png';
$famime = 'file-powerpoint-o'; $famime = 'file-powerpoint-o';
} } elseif (preg_match('/\.ods$/i', $tmpfile)) {
if (preg_match('/\.ods$/i', $tmpfile)) {
$mime = 'application/vnd.oasis.opendocument.spreadsheet'; $mime = 'application/vnd.oasis.opendocument.spreadsheet';
$imgmime = 'ooffice.png'; $imgmime = 'ooffice.png';
$famime = 'file-excel-o'; $famime = 'file-excel-o';
} } elseif (preg_match('/\.odt$/i', $tmpfile)) {
if (preg_match('/\.odt$/i', $tmpfile)) {
$mime = 'application/vnd.oasis.opendocument.text'; $mime = 'application/vnd.oasis.opendocument.text';
$imgmime = 'ooffice.png'; $imgmime = 'ooffice.png';
$famime = 'file-word-o'; $famime = 'file-word-o';
} } // phpcs:ignore
// MS Office // MS Office
if (preg_match('/\.mdb$/i', $tmpfile)) { elseif (preg_match('/\.mdb$/i', $tmpfile)) {
$mime = 'application/msaccess'; $mime = 'application/msaccess';
$imgmime = 'mdb.png'; $imgmime = 'mdb.png';
$famime = 'file-o'; $famime = 'file-o';
} } elseif (preg_match('/\.doc[xm]?$/i', $tmpfile)) {
if (preg_match('/\.doc[xm]?$/i', $tmpfile)) {
$mime = 'application/msword'; $mime = 'application/msword';
$imgmime = 'doc.png'; $imgmime = 'doc.png';
$famime = 'file-word-o'; $famime = 'file-word-o';
} } elseif (preg_match('/\.dot[xm]?$/i', $tmpfile)) {
if (preg_match('/\.dot[xm]?$/i', $tmpfile)) {
$mime = 'application/msword'; $mime = 'application/msword';
$imgmime = 'doc.png'; $imgmime = 'doc.png';
$famime = 'file-word-o'; $famime = 'file-word-o';
} } elseif (preg_match('/\.xlt(x)?$/i', $tmpfile)) {
if (preg_match('/\.xlt(x)?$/i', $tmpfile)) {
$mime = 'application/vnd.ms-excel'; $mime = 'application/vnd.ms-excel';
$imgmime = 'xls.png'; $imgmime = 'xls.png';
$famime = 'file-excel-o'; $famime = 'file-excel-o';
} } elseif (preg_match('/\.xla(m)?$/i', $tmpfile)) {
if (preg_match('/\.xla(m)?$/i', $tmpfile)) {
$mime = 'application/vnd.ms-excel'; $mime = 'application/vnd.ms-excel';
$imgmime = 'xls.png'; $imgmime = 'xls.png';
$famime = 'file-excel-o'; $famime = 'file-excel-o';
} } elseif (preg_match('/\.xls$/i', $tmpfile)) {
if (preg_match('/\.xls$/i', $tmpfile)) {
$mime = 'application/vnd.ms-excel'; $mime = 'application/vnd.ms-excel';
$imgmime = 'xls.png'; $imgmime = 'xls.png';
$famime = 'file-excel-o'; $famime = 'file-excel-o';
} } elseif (preg_match('/\.xls[bmx]$/i', $tmpfile)) {
if (preg_match('/\.xls[bmx]$/i', $tmpfile)) {
$mime = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; $mime = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
$imgmime = 'xls.png'; $imgmime = 'xls.png';
$famime = 'file-excel-o'; $famime = 'file-excel-o';
} } elseif (preg_match('/\.pps[mx]?$/i', $tmpfile)) {
if (preg_match('/\.pps[mx]?$/i', $tmpfile)) {
$mime = 'application/vnd.ms-powerpoint'; $mime = 'application/vnd.ms-powerpoint';
$imgmime = 'ppt.png'; $imgmime = 'ppt.png';
$famime = 'file-powerpoint-o'; $famime = 'file-powerpoint-o';
} } elseif (preg_match('/\.ppt[mx]?$/i', $tmpfile)) {
if (preg_match('/\.ppt[mx]?$/i', $tmpfile)) {
$mime = 'application/x-mspowerpoint'; $mime = 'application/x-mspowerpoint';
$imgmime = 'ppt.png'; $imgmime = 'ppt.png';
$famime = 'file-powerpoint-o'; $famime = 'file-powerpoint-o';
} } // phpcs:ignore
// Other // Other
if (preg_match('/\.pdf$/i', $tmpfile)) { elseif (preg_match('/\.pdf$/i', $tmpfile)) {
$mime = 'application/pdf'; $mime = 'application/pdf';
$imgmime = 'pdf.png'; $imgmime = 'pdf.png';
$famime = 'file-pdf-o'; $famime = 'file-pdf-o';
} } // phpcs:ignore
// Scripts // Scripts
if (preg_match('/\.bat$/i', $tmpfile)) { elseif (preg_match('/\.bat$/i', $tmpfile)) {
$mime = 'text/x-bat'; $mime = 'text/x-bat';
$imgmime = 'script.png'; $imgmime = 'script.png';
$srclang = 'dos'; $srclang = 'dos';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.sh$/i', $tmpfile)) {
if (preg_match('/\.sh$/i', $tmpfile)) {
$mime = 'text/x-sh'; $mime = 'text/x-sh';
$imgmime = 'script.png'; $imgmime = 'script.png';
$srclang = 'bash'; $srclang = 'bash';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.ksh$/i', $tmpfile)) {
if (preg_match('/\.ksh$/i', $tmpfile)) {
$mime = 'text/x-ksh'; $mime = 'text/x-ksh';
$imgmime = 'script.png'; $imgmime = 'script.png';
$srclang = 'bash'; $srclang = 'bash';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.bash$/i', $tmpfile)) {
if (preg_match('/\.bash$/i', $tmpfile)) {
$mime = 'text/x-bash'; $mime = 'text/x-bash';
$imgmime = 'script.png'; $imgmime = 'script.png';
$srclang = 'bash'; $srclang = 'bash';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } // phpcs:ignore
// Images // Images
if (preg_match('/\.ico$/i', $tmpfile)) { elseif (preg_match('/\.ico$/i', $tmpfile)) {
$mime = 'image/x-icon'; $mime = 'image/x-icon';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.(jpg|jpeg)$/i', $tmpfile)) {
if (preg_match('/\.(jpg|jpeg)$/i', $tmpfile)) {
$mime = 'image/jpeg'; $mime = 'image/jpeg';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.png$/i', $tmpfile)) {
if (preg_match('/\.png$/i', $tmpfile)) {
$mime = 'image/png'; $mime = 'image/png';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.gif$/i', $tmpfile)) {
if (preg_match('/\.gif$/i', $tmpfile)) {
$mime = 'image/gif'; $mime = 'image/gif';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.bmp$/i', $tmpfile)) {
if (preg_match('/\.bmp$/i', $tmpfile)) {
$mime = 'image/bmp'; $mime = 'image/bmp';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.(tif|tiff)$/i', $tmpfile)) {
if (preg_match('/\.(tif|tiff)$/i', $tmpfile)) {
$mime = 'image/tiff'; $mime = 'image/tiff';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.svg$/i', $tmpfile)) {
if (preg_match('/\.svg$/i', $tmpfile)) {
$mime = 'image/svg+xml'; $mime = 'image/svg+xml';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.webp$/i', $tmpfile)) {
if (preg_match('/\.webp$/i', $tmpfile)) {
$mime = 'image/webp'; $mime = 'image/webp';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } // phpcs:ignore
// Calendar // Calendar
if (preg_match('/\.vcs$/i', $tmpfile)) { elseif (preg_match('/\.vcs$/i', $tmpfile)) {
$mime = 'text/calendar'; $mime = 'text/calendar';
$imgmime = 'other.png'; $imgmime = 'other.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.ics$/i', $tmpfile)) {
if (preg_match('/\.ics$/i', $tmpfile)) {
$mime = 'text/calendar'; $mime = 'text/calendar';
$imgmime = 'other.png'; $imgmime = 'other.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } // phpcs:ignore
// Other // Other
if (preg_match('/\.torrent$/i', $tmpfile)) { elseif (preg_match('/\.torrent$/i', $tmpfile)) {
$mime = 'application/x-bittorrent'; $mime = 'application/x-bittorrent';
$imgmime = 'other.png'; $imgmime = 'other.png';
$famime = 'file-o'; $famime = 'file-o';
} } // phpcs:ignore
// Audio // Audio
if (preg_match('/\.(mp3|ogg|au|wav|wma|mid)$/i', $tmpfile)) { elseif (preg_match('/\.(mp3|ogg|au|wav|wma|mid)$/i', $tmpfile)) {
$mime = 'audio'; $mime = 'audio';
$imgmime = 'audio.png'; $imgmime = 'audio.png';
$famime = 'file-audio-o'; $famime = 'file-audio-o';
} } // phpcs:ignore
// Video // Video
if (preg_match('/\.mp4$/i', $tmpfile)) { elseif (preg_match('/\.mp4$/i', $tmpfile)) {
$mime = 'video/mp4'; $mime = 'video/mp4';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.ogv$/i', $tmpfile)) {
if (preg_match('/\.ogv$/i', $tmpfile)) {
$mime = 'video/ogg'; $mime = 'video/ogg';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.webm$/i', $tmpfile)) {
if (preg_match('/\.webm$/i', $tmpfile)) {
$mime = 'video/webm'; $mime = 'video/webm';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.avi$/i', $tmpfile)) {
if (preg_match('/\.avi$/i', $tmpfile)) {
$mime = 'video/x-msvideo'; $mime = 'video/x-msvideo';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.divx$/i', $tmpfile)) {
if (preg_match('/\.divx$/i', $tmpfile)) {
$mime = 'video/divx'; $mime = 'video/divx';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.xvid$/i', $tmpfile)) {
if (preg_match('/\.xvid$/i', $tmpfile)) {
$mime = 'video/xvid'; $mime = 'video/xvid';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.(wmv|mpg|mpeg)$/i', $tmpfile)) {
if (preg_match('/\.(wmv|mpg|mpeg)$/i', $tmpfile)) {
$mime = 'video'; $mime = 'video';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } // phpcs:ignore
// Archive // Archive
if (preg_match('/\.(zip|rar|gz|tgz|z|cab|bz2|7z|tar|lzh|zst)$/i', $tmpfile)) { elseif (preg_match('/\.(zip|rar|gz|tgz|z|cab|bz2|7z|tar|lzh|zst)$/i', $tmpfile)) {
// application/xxx where zzz is zip, ...
$mime = 'archive'; $mime = 'archive';
$imgmime = 'archive.png'; $imgmime = 'archive.png';
$famime = 'file-archive-o'; $famime = 'file-archive-o';
} // application/xxx where zzz is zip, ... } // phpcs:ignore
// Exe // Exe
if (preg_match('/\.(exe|com)$/i', $tmpfile)) { elseif (preg_match('/\.(exe|com)$/i', $tmpfile)) {
$mime = 'application/octet-stream'; $mime = 'application/octet-stream';
$imgmime = 'other.png'; $imgmime = 'other.png';
$famime = 'file-o'; $famime = 'file-o';
} } // phpcs:ignore
// Lib // Lib
if (preg_match('/\.(dll|lib|o|so|a)$/i', $tmpfile)) { elseif (preg_match('/\.(dll|lib|o|so|a)$/i', $tmpfile)) {
$mime = 'library'; $mime = 'library';
$imgmime = 'library.png'; $imgmime = 'library.png';
$famime = 'file-o'; $famime = 'file-o';
} } // phpcs:ignore
// Err // Err
if (preg_match('/\.err$/i', $tmpfile)) { elseif (preg_match('/\.err$/i', $tmpfile)) {
$mime = 'error'; $mime = 'error';
$imgmime = 'error.png'; $imgmime = 'error.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } // phpcs:ignore
// Return string // Return mimetype string
if ($mode == 1) { switch ((int) $mode) {
case 1:
$tmp = explode('/', $mime); $tmp = explode('/', $mime);
return (!empty($tmp[1]) ? $tmp[1] : $tmp[0]); return (!empty($tmp[1]) ? $tmp[1] : $tmp[0]);
} case 2:
if ($mode == 2) {
return $imgmime; return $imgmime;
} case 3:
if ($mode == 3) {
return $srclang; return $srclang;
} case 4:
if ($mode == 4) {
return $famime; return $famime;
} }
return $mime; return $mime;