Skip to content

Commit

Permalink
Added fallback in case of an unknown email priority
Browse files Browse the repository at this point in the history
  • Loading branch information
SL-Gundam committed Aug 23, 2016
1 parent b98e48f commit c587341
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/mail_api.php
Expand Up @@ -637,7 +637,15 @@ private function parse_content( &$p_msg )
unset( $t_part );
}

$t_email[ 'Priority' ] = $this->_mail_bug_priority[ strtolower( $t_mp->priority() ) ];
if ( isset( $this->_mail_bug_priority[ strtolower( $t_mp->priority() ) ] ) )
{
$t_email[ 'Priority' ] = $this->_mail_bug_priority[ strtolower( $t_mp->priority() ) ];
}
else
{
$this->custom_error( 'Unknown priority encountered (' . strtolower( $t_mp->priority() ) . '). Falling back to default priority', FALSE );
$t_email[ 'Priority' ] = FALSE;
}

$t_email[ 'Message-ID' ] = $t_mp->messageid();
$t_email[ 'References' ] = $t_mp->references();
Expand Down Expand Up @@ -832,7 +840,7 @@ private function add_bug( &$p_email, $p_overwrite_project_id = FALSE )
$t_bug_data->reproducibility = (int) config_get( 'default_bug_reproducibility' );
$t_bug_data->severity = (int) config_get( 'default_bug_severity' );

$t_bug_data->priority = (int) ( ( $this->_mail_use_bug_priority ) ? $p_email[ 'Priority' ] : config_get( 'default_bug_priority' ) );
$t_bug_data->priority = (int) ( ( $this->_mail_use_bug_priority && $p_email[ 'Priority' ] !== FALSE ) ? $p_email[ 'Priority' ] : config_get( 'default_bug_priority' ) );
$t_bug_data->projection = (int) config_get( 'default_bug_projection' );
$t_bug_data->eta = (int) config_get( 'default_bug_eta' );
$t_bug_data->resolution = config_get( 'default_bug_resolution' );
Expand Down
1 change: 1 addition & 0 deletions doc/CHANGELOG.txt
Expand Up @@ -2,6 +2,7 @@ Changelog:
Jul 2016 - EmailReporting-0.9.3-DEV
- Fix possible fatal error on return value
- Added error when __construct is not run when it should have
- Added fallback in case of an unknown email priority

Jul 2016 - EmailReporting-0.9.2
- Fixed collation check issue with MantisBT 1.3.x
Expand Down

0 comments on commit c587341

Please sign in to comment.