View Issue Details

IDProjectCategoryView StatusLast Update
0009890mantisbtbugtrackerpublic2008-12-16 08:38
Reportermigu Assigned Tojreese  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version1.1.6Fixed in Version1.1.6 
Summary0009890: Case of extension for inline image is not ignored
Description

The configuration variable $g_inline_file_exts (inline_file_exts) allows the definition of file extensions that are to be displayed inline.
However, in file_download.php the extensions' case is relevant. This leads to the problem that files with extensions in upper case are not displayed inline.

A quick workaround is to specify all extensions both in lower and in upper case. This is neither comfortable nor obvious to the user, though.

Steps To Reproduce
  1. Let $g_inline_file_exts be set to 'png,jpg,jpeg,gif'.
  2. Attach a file with one of those extensions in upper case. (e.g. image.PNG)
  3. Display the issue report.
  4. The image attachment is not shown inline, but it is offered for download.
Additional Information

I found the described behavior in versions 1.1.2 and 1.1.5.

The problem is in line 94 of file_download.php:
if ( in_array( file_get_extension($t_filename), $t_inline_files ) ) {

To fix the problem, just lower case the filename:
if ( in_array( strtolower(file_get_extension($t_filename)), $t_inline_files ) ) {

Tagsattachments

Activities

jreese

jreese

2008-11-25 08:42

reporter   ~0020029

Confirmed the behavior.

jreese

jreese

2008-11-25 14:56

reporter   ~0020040

Fix has been committed to 1.1.6 and 1.2.x development trees.

Related Changesets

MantisBT: master 7806422c

2008-11-25 14:54

jreese


Details Diff
Fix 0009890: improper comparison of file extensions in file_download.php Affected Issues
0009890
mod - file_download.php Diff File

MantisBT: master-1.1.x 99903fda

2008-11-25 14:54

jreese


Details Diff
Fix 0009890: improper comparison of file extensions in file_download.php Affected Issues
0009890
mod - file_download.php Diff File