View Issue Details

IDProjectCategoryView StatusLast Update
0019879mantisbtattachmentspublic2016-08-15 09:02
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0 
Target Version1.2.20Fixed in Version1.2.20 
Summary0019879: Download page triggers errors when file does not exist
Description

When file_download.php is called with a non-existent file ID, the page generates PHP notices/warnings (and an error when type=bug)

Steps To Reproduce

Where 99999 is a file attachment ID that does not exist :

  • http://localhost/mantis/file_download.php?file_id=99999&type=doc


    SYSTEM NOTICE: 'Undefined variable: v_date_added' in '/path/to/mantisbt/file_download.php' line 145
    SYSTEM WARNING: 'Cannot modify header information - headers already sent by (output started at /path/to/mantisbt/core\error_api.php:279)' in '/path/to/mantisbt/file_download.php' line 145
    SYSTEM NOTICE: 'Undefined variable: v_filename' in '/path/to/mantisbt/file_download.php' line 148
    SYSTEM NOTICE: 'Undefined variable: v_file_type' in '/path/to/mantisbt/file_download.php' line 155
    SYSTEM NOTICE: 'Undefined variable: v_content' in '/path/to/mantisbt/file_download.php' line 169
    SYSTEM WARNING: 'Cannot modify header information - headers already sent by (output started at /path/to/mantisbt/core\error_api.php:279)' in '/path/to/mantisbt/file_download.php' line 192
    SYSTEM NOTICE: 'Undefined variable: v_filesize' in '/path/to/mantisbt/file_download.php' line 193
    SYSTEM WARNING: 'Cannot modify header information - headers already sent by (output started at /path/to/mantisbt/core\error_api.php:279)' in '/path/to/mantisbt/file_download.php' line 193
    SYSTEM WARNING: 'Cannot modify header information - headers already sent by (output started at /path/to/mantisbt/core\error_api.php:279)' in '/path/to/mantisbt/file_download.php' line 199
    SYSTEM NOTICE: 'Undefined variable: v_content' in '/path/to/mantisbt/file_download.php' line 207

  • http://localhost/mantis/file_download.php?file_id=99999&type=bug


    SYSTEM WARNING: 'extract() expects parameter 1 to be array, boolean given' in '/path/to/mantisbt/file_download.php' line 94
    SYSTEM NOTICE: 'Undefined variable: v_bug_id' in '/path/to/mantisbt/file_download.php' line 97
    APPLICATION ERROR 1100 - Issue 0 not found.

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master-1.2.x 2a042504

2015-06-24 04:24

dregad


Details Diff
Trigger generic error when downloading non-existent attachment

This prevents PHP warnings and notices as the code attempts to process
an empty result set from the query.

Backport from b96e49d5e6d43c2fa89d894222a89b308485d1d8

Fixes 0019879
Affected Issues
0019879
mod - file_download.php Diff File

MantisBT: master b96e49d5

2015-06-24 04:24

dregad


Details Diff
Trigger generic error when downloading non-existent attachment

This prevents PHP warnings and notices as the code attempts to process
an empty result set from the query.

Fixes 0019879
Affected Issues
0019879
mod - file_download.php Diff File