pRieStaKos Posted June 28, 2021 Share Posted June 28, 2021 Hello, This issue is on WHMCS from the start and now I'm trying to find a solution. - When a client posts an attachments with a non-Latin filename (in our case greek letters), WHMCS trims the non-latin file name and generates the rest and stores the attachment to it's system. I asked on WHMCS Support Chat for a hook action that I can convert the attachments filename to latin but the answer is that there is no related action hook to interfere with the attachment process. Anyone has implemented anything related for the ticket attachments or a suggestion what to check for WHMCS ? Thank you in advance. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted June 28, 2021 Share Posted June 28, 2021 (edited) You can't. According to WHMCS the problem is Greek alphabet. People should stop using it. Joking apart, I can think of several solutions. I refuse to share details (personal reasons) however I can give you few hints. Solution 1 (recommended but super boring): https://developers.whmcs.com/hooks-reference/client-area-interface/#clientareapage tblticketreplies.attachment explode('|', $var) https://www.php.net/manual/en/class.transliterator.php Solution 2 (not recommended, not safe and still pretty boring): https://developers.whmcs.com/hooks-reference/output/#clientareaheaderoutput jQuery Create a lib like this one https://plugins.jquery.com/tag/transliteration/ Solution 3 (not recommended and boring): https://developers.whmcs.com/hooks-reference/ticket/#ticketopen Iterate str_replace(array(), array(), $files) on both attachments folder and tblticketreplies.attachment column Good luck. Edited June 28, 2021 by Kian 1 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted June 28, 2021 Author Share Posted June 28, 2021 18 minutes ago, Kian said: People should stop using it. You cannot stop using a birth language. 😆 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 28, 2021 Share Posted June 28, 2021 4 hours ago, pRieStaKos said: This issue is on WHMCS from the start and now I'm trying to find a solution. patience of a saint! 😇 4 hours ago, pRieStaKos said: I asked on WHMCS Support Chat for a hook action that I can convert the attachments filename to latin but the answer is that there is no related action hook to interfere with the attachment process. AFAIK, the filename is sanitised before upload - and once sanitised, the old unsanitised name is forever lost. 5 hours ago, pRieStaKos said: Anyone has implemented anything related for the ticket attachments or a suggestion what to check for WHMCS ? you might need to look at renaming them on the fly yourself before submission (assuming that once in the system, the original filenames are dumped). frankly, i'd defer to Kian on this with his suggestions.... and his suspicion about the solution WHMCS would prefer. 🙂 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.