Page 1 of 1

email2ticket not utf-8 characters

Posted: Thu Oct 30, 2014 9:02 am
by depperdc
Script URL:
Version of script:
Hosting company: HESK version: 2.5.3
URL of phpinfo.php: 5.3.3 (MySQLi)
MySQL version: 5.1.73
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

Hello,
when manually adding attachments to tickets, the system automatically changes the characters with diacritics to characters without diacritics, it is ok (submit ticket).
When automatically insert attachments (function email2ticket) Czech characters are not converted, but system shortened attachment at the first Czech character.
Problem is, that In this shortening system will remove the suffix (in ticket). The original file stored in the system Hesk is fine.

Re: email2ticket not utf-8 characters

Posted: Thu Oct 30, 2014 11:00 am
by Klemen
Hi,

Could you send a sample problematic file to "pop3test" AT "hesk" DOT "com" so I can have a look?

Re: email2ticket not utf-8 characters

Posted: Thu Oct 30, 2014 12:14 pm
by depperdc
Yes. Send

Re: email2ticket not utf-8 characters

Posted: Thu Oct 30, 2014 7:09 pm
by rox
Same problem here. Please help us :)

Re: email2ticket not utf-8 characters

Posted: Thu Oct 30, 2014 9:57 pm
by Klemen
Please try this:

1. download this file

2. upload "posting_functions.inc.php" to your HESK "inc" folder (overwrite existing file)

3. test

Could you confirm this resolves the issue?

This change should remove any character from the name it doesn't detect and convert. It's not perfect (file name will change), but better than loosing the attachment.

Re: email2ticket not utf-8 characters

Posted: Fri Oct 31, 2014 9:43 am
by depperdc
Hello,
on a test copy of Hesk, everything works. When you copy the final system Hesk occurred mail processing cycle (cycle was creating tickets).
Please rewrite the procedure step by step.
Restart httpd not help me.
Excuse my English

Re: email2ticket not utf-8 characters

Posted: Fri Oct 31, 2014 10:04 am
by Klemen
I am afraid I do not understand what you mean.

Try this:

1. enable HESK debug mode in settings (admin panel > Settings > Help Desk tab > Features > Debug mode: ON)

2. explain step-by-step what you are doing, what happens and what error messages you see

Re: email2ticket not utf-8 characters

Posted: Fri Oct 31, 2014 10:36 am
by rox
Dear Klemen,
Your solution worked for polish diacritics. Maybe it is not perfect, but now i see the attachment with an extension and can view it properly.

Thank You very much :)

Re: email2ticket not utf-8 characters

Posted: Fri Oct 31, 2014 8:46 pm
by depperdc
Thanks, resolved..
add to original file line 162:

Code: Select all

   $filename = preg_replace('/[^\x20-\x7E]/','', $filename);
  	if ( strlen($filename) < 1 )
  	{
	   	$filename = mt_rand(10000,99999);
	  }
	return $filename;
My previous administrator here HESK regulate, so your fix did not work. this function it resolved.