View Issue Details

IDProjectCategoryView StatusLast Update
0014448mantisbtattachmentspublic2014-09-23 18:05
Reporterawerner Assigned Toatrol  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
PlatformLAMPOSLinuxOS Version2.6.30.7
Product Version1.2.11 
Target Version1.2.12Fixed in Version1.2.12 
Summary0014448: 'Undefined index: jpg' in '.../core/file_api.php' line 917
Description

When dowloading an attachment from a bug issue, whose file extension is not defined through an override, the following error is written into the output:

SYSTEM NOTICE: 'Undefined index: jpg' in '.../core/file_api.php' line 917

SYSTEM WARNING: 'Cannot modify header information - headers already sent by (output started at .../core/error_api.php:202)' in '.../file_download.php' line 167

The ... are replacing the full path to the module.
The PHP is Version 5.2.17

TagsNo tags attached.

Relationships

related to 0013439 closedrombert Wrong Content-type for various MSOffice documents 
related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

atrol

atrol

2012-07-03 15:44

developer   ~0032238

'.../core/file_api.php' line 917
Probably not version 1.2.11 of MantisBT
Number of lines of file_api.php is 910

atrol

atrol

2012-07-03 16:16

developer   ~0032239

Can you try replacing function file_get_content_type_override in file_api.php by the following code

function file_get_content_type_override( $p_filename ) {

global $g_file_download_content_type_overrides;

$t_extension = pathinfo( $p_filename, PATHINFO_EXTENSION );

if ( isset ( $g_file_download_content_type_overrides[$t_extension] ) ) {
    return $g_file_download_content_type_overrides[$t_extension];
}
return false;

}

atrol

atrol

2012-07-04 02:46

developer   ~0032240

One more question:
Did you change default settings of $g_display_errors ?

awerner

awerner

2012-07-04 04:39

reporter   ~0032245

Dear atrol,

This additional "if" statement solves the problem, thanks a lot.

For testing purposes, I have set:
$g_display_errors = array(
E_WARNING => 'inline',
E_NOTICE => 'inline',
E_USER_ERROR => 'halt',
E_USER_WARNING => 'inline',
E_USER_NOTICE => 'inline'
);

Kind regards,
awerner

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036156

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master-1.2.x 79e4d02d

2012-07-09 08:48

atrol


Details Diff
Fix 0014448: 'Undefined index: jpg' in '.../core/file_api.php' Affected Issues
0014448
mod - core/file_api.php Diff File

MantisBT: master 8945fcc6

2012-07-09 08:52

atrol


Details Diff
Fix 0014448: 'Undefined index: jpg' in '.../core/file_api.php' Affected Issues
0014448
mod - core/file_api.php Diff File