Jump to content

[Support Manager] - Email/ticket Import Removes Special Characters


PauloV

Recommended Posts

Hello,

 

Problem:

 

Describe the issue you're experiencing:
Reciving/Importing emails to Tickets, removes special characters like Latin Characters (á|ã|â|à|é|è|ê|í|ì|î|ó|ò|ô|õ|ú|ù|û|)
 
Provide detailed steps necessary to reproduce the issue:
Send an email to Blesta import with characters like por exemple á|ã|â|à|é|è|ê|í|ì|î|ó|ò|ô|õ|ú|ù|û|
 
 
 
Solution:

 

After days testing, tracing and debuging, we finally detect the issues:

 

1º First problem detected: On file plugins/support_manager/vendors/html2text/html2text.class.php we have fount that characters encoded as html are being removed by the line 187:

          '/&[^&;]+;/i',                           // Unknown/unhandled entities

and on line 239:

        '',                                     // Unknown/unhandled entities

We have coment this two lines to not remove the encoded characters like so:

 

change to, on line 187:

          //'/&[^&;]+;/i',                           // Unknown/unhandled entities

change to, on line 239:

        '',                                     // Unknown/unhandled entities

/////////////////////////////////////////////////////////////////////////////

Small extra note and fix: If you whant to see break lines on Tickets (I sure you do :) ), just do this also on this file:

 

find on the same file on line 147:

        "/[\n\t]+/",                             // Newlines and tabs

change to:

        "/[\t]+/",                               // Tabs

/////////////////////////////////////////////////////////////////////////////

 

2º Second problem detected: We have detected that html_entity_decode was not being used on body and subject of the email to translate special characters, so to fix it do:

 

Open file: plugins\support_manager\components\email_parser\email_parser.php

 

find on line 174:

		// Prefer conversion using iconv, but if the character set is not

change to:

        // Decode encoded characters
        $text = html_entity_decode($text);

	// Prefer conversion using iconv, but if the character set is not

3º The final problem detected, is that the class html2text was being called one second time from "vendors\html2text\" directory, and its not nedded, causing more problems than fixing them :)

 

Open file: plugins\support_manager\views\default\admin_tickets_reply.pdt

 

find on line 186:

								<?php echo $this->TextParser->encode("markdown", $this->Html->_($reply->details, true));?>

change to (this fix also fixes the breaklines issue):

								<?php echo nl2br($this->Html->_($reply->details, true));?>

Open file: plugins\support_manager\views\default\client_tickets_reply.pdt

 

find on line 137:

								<?php echo $this->TextParser->encode("markdown", $this->Html->_($reply->details, true));?>

change to (this fix also fixes the breaklines issue):

								<?php echo nl2br($this->Html->_($reply->details, true));?>

And thats it :)

 

I hope this will help outhers.

 

Blesta can close this issue :)

 

 

Regards,

PV

Edited by Paulo V
Link to comment
Share on other sites

there is some more bugs that we detected. will investigate more than post here.

 

the latest bug is on pipe retuning:

 

Object of class MimeMailParser could not be converted to string on line 124 /home/username/public_html/blesta/lib/model.php

 

Update with a fix, on the first post.

Edited by Paulo V
Link to comment
Share on other sites

  • 4 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...