View Issue Details

IDProjectCategoryView StatusLast Update
0019879mantisbtattachmentspublic2016-08-15 09:02
ReporterdregadAssigned 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 08:24:52

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
mod - file_download.php Diff File

MantisBT: master b96e49d5

2015-06-24 08:24:52

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
mod - file_download.php Diff File

Issue History

Date Modified Username Field Change
2015-06-24 09:11 dregad New Issue
2015-06-24 09:11 dregad Status new => assigned
2015-06-24 09:11 dregad Assigned To => dregad
2015-06-24 18:58 dregad Changeset attached => MantisBT master-1.2.x 2a042504
2015-06-24 18:58 dregad Status assigned => resolved
2015-06-24 18:58 dregad Resolution open => fixed
2015-06-24 18:58 dregad Fixed in Version => 1.2.20
2015-06-24 18:59 dregad Changeset attached => MantisBT master b96e49d5
2015-06-24 19:01 dregad Target Version => 1.2.20
2016-08-15 09:02 dregad Status resolved => closed