Skip to content

Commit

Permalink
Revert "Added a workaround for situations where the subject or email …
Browse files Browse the repository at this point in the history
…body is too big for MantisBT standards"

This reverts commit 83698d2.

These commits are not needed in a proper MantisBT environment
  • Loading branch information
SL-Gundam committed Jun 17, 2014
1 parent 1420c23 commit f938c80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 43 deletions.
44 changes: 2 additions & 42 deletions core/mail_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ class ERP_mailbox_api
private $_use_ldap_email;

private $_max_file_size;
private $_max_text_len = 65535; // mysql text datatype
private $_max_subject_len = 128; // mysql varchar(128) datatype
private $_memory_limit;

# --------------------
Expand Down Expand Up @@ -738,7 +736,6 @@ private function add_bug( &$p_email, $p_overwrite_project_id = FALSE )

$t_description = $this->identify_replies( $t_description );
$t_description = $this->strip_signature( $t_description );
$this->check_field_lengths( 'note', $p_email, $t_description );
$t_description = $this->add_additional_info( 'note', $p_email, $t_description );

$t_project_id = bug_get_field( $t_bug_id, 'project_id' );
Expand Down Expand Up @@ -789,14 +786,11 @@ private function add_bug( &$p_email, $p_overwrite_project_id = FALSE )
$t_bug_data->eta = (int) config_get( 'default_bug_eta' );
$t_bug_data->resolution = config_get( 'default_bug_resolution' );
$t_bug_data->status = config_get( 'bug_submit_status' );
$t_bug_data->summary = $p_email[ 'Subject' ];

$t_description = $p_email[ 'X-Mantis-Body' ];
$t_description = $this->strip_signature( $t_description );
$this->check_field_lengths( 'issue', $p_email, $t_description );
$t_description = $this->add_additional_info( 'issue', $p_email, $t_description );

$t_bug_data->summary = $p_email[ 'Subject' ];

$t_bug_data->description = $t_description;

$t_bug_data->steps_to_reproduce = config_get( 'default_bug_steps_to_reproduce' );
Expand Down Expand Up @@ -1355,11 +1349,7 @@ private function add_additional_info( $p_type, &$p_email, $p_description )
$t_additional_info .= "\n";
}

$p_description = $t_additional_info . $p_description;

$this->check_field_lengths( $p_type, $p_email, $p_description );

return( $p_description );
return( $t_additional_info . $p_description );
}

# --------------------
Expand All @@ -1383,36 +1373,6 @@ private function strip_signature( $p_description )
return( $t_description );
}

# --------------------
# Check the subject and email body to see if they are too long for MantisBT database fields
private function check_field_lengths( $p_type, &$p_email, &$p_description )
{
if ( strlen( $p_email[ 'Subject' ] ) > $this->_max_subject_len )
{
$p_email[ 'Subject' ] = substr( $p_email[ 'Subject' ], 0, $this->_max_subject_len );
}

if ( strlen( $p_description ) > $this->_max_text_len )
{
if ( $this->_allow_file_upload )
{
$t_part = array(
'name' => $p_type . '_description.txt',
'ctype' => 'text/plain',
'body' => $p_description,
);

$p_description = 'Email body was too big. It has been moved to the attachments';

array_push( $p_email[ 'X-Mantis-Parts' ], $t_part );
}
else
{
$p_description = substr( $p_description, 0, $this->_max_text_len );
}
}
}

# --------------------
# Show memory usage in debug mode
private function show_memory_usage( $p_location )
Expand Down
1 change: 0 additions & 1 deletion doc/CHANGELOG.bug_report_mail.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ Nov 2013 - EmailReporting-0.9.0-DEV
- Attachment blocking added based on a md5 hash list
- Added feature to remove Gmail style replies in notes
- Added feature to add users from Cc and To list of mail header to issue monitoring list
- Added a workaround for situations where the subject or email body is too big for MantisBT standards

Nov 2010 - EmailReporting-0.8.4
- Improved the project category list
Expand Down

0 comments on commit f938c80

Please sign in to comment.