Changeset 5770 in subversion for branches/release-0.7/program/include/rcube_shared.inc
- Timestamp:
- Jan 13, 2012 6:23:17 AM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/release-0.7/program/include/rcube_shared.inc
r5715 r5770 363 363 $mime_magic = rcmail::get_instance()->config->get('mime_magic'); 364 364 $mime_ext = @include(RCMAIL_CONFIG_DIR . '/mimetypes.php'); 365 $suffix = $name ? substr($name, strrpos($name, '.')+1) : '*';366 365 367 366 // use file name suffix with hard-coded mime-type map 368 if (is_array($mime_ext)) { 369 $mime_type = $mime_ext[$suffix]; 370 } 367 if (is_array($mime_ext) && $name) { 368 if ($suffix = substr($name, strrpos($name, '.')+1)) { 369 $mime_type = $mime_ext[strtolower($suffix)]; 370 } 371 } 372 371 373 // try fileinfo extension if available 372 374 if (!$mime_type && function_exists('finfo_open')) { … … 379 381 } 380 382 } 383 381 384 // try PHP's mime_content_type 382 385 if (!$mime_type && !$is_stream && function_exists('mime_content_type')) { 383 386 $mime_type = @mime_content_type($path); 384 387 } 388 385 389 // fall back to user-submitted string 386 390 if (!$mime_type) {
Note: See TracChangeset
for help on using the changeset viewer.
