Support Ticketing System module file name error fix

To fix Support Ticketing System module filename error I have used this hack in support.module. The problem is that if the file name contains other characters than A-Z it end up in some unconverted file name that is not good looking and can in some cases make it hard to open. The file name can look like this: "=?ISO-8859-1?Q?Spr=E5khantering=2Epdf?=" when it should be "Språkhantering.pdf". It seems like urldecode() encounters a problem and returns some sort of ISO string. My solution was to replace all non A-Z characters by "x". Maybe there is some better solution...


<?php
//$attachment->filename = $parm->value;
$attachment->filename = iconv_mime_decode(urldecode($parm->value), 0 ,"ISO-8859-1");
$attachment->filename = preg_replace('/[^0-9a-zA-Z\.\_\-\ ]/i', "x", $attachment->filename);
?>
Knowledge keywords: