View Issue Details

IDProjectCategoryView StatusLast Update
0009928mantisbtotherpublic2008-12-16 08:38
Reporterjreese Assigned Tojreese  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version1.1.5 
Target Version1.1.6Fixed in Version1.1.6 
Summary0009928: Inconsistent uses of file extension configuration settings.
Description

I found this issue while investing issue 0009890. We have three separate configuration values for selecting what file extensions can be viewed inline, shown as text, etc:

   # Extensions for text files that can be expanded inline.
$g_preview_text_extensions = array( 'txt', 'diff', 'patch' );

# Extensions for images that can be expanded inline.
$g_preview_image_extensions = array( 'bmp', 'png', 'gif', 'jpg', 'jpeg' );

# list of filetypes to view inline. This is a string of extentions separated by commas
# This is used when downloading an attachment.  Rather than downloading, the attachment
# is viewed in the browser.
$g_inline_file_exts = 'gif,png';</pre>

It seems to me that:

  • The duplication of image extensions is confusing and unnecessary
  • The difference in definition (array vs string) is also confusing

To add to all this, when viewing the list of bug attachments, the following configuration setting is improperly checked:

   # Specifies the maximum size (in bytes) below which an attachment is 

previewed in the bug view pages.

# To disable this feature, set max size to 0.
$g_preview_attachments_inline_max_size = 0;</pre>

When listing attachments, the code only checks that 'file_size <= max_size', and ignores the documented (and default) use of 0 as meaning 'no limit'. This should be rectified in core/file_api.php (1.1.x) and core/print_api.php (1.2.x).

TagsNo tags attached.

Relationships

child of 0009894 closedjreese Inconsistent uses of file extension configuration settings. 

Activities

jreese

jreese

2008-12-02 14:02

reporter   ~0020193

Fix committed to 1.1.6 tree.

Related Changesets

MantisBT: master-1.1.x 739397fe

2008-12-02 13:52

jreese


Details Diff
Fix 0009894: inconsistent set of file extensions for attachments. Affected Issues
0009894, 0009928
mod - config_defaults_inc.php Diff File