Greek names in attachments do not show

anonymous wrote on Wednesday, May 30, 2012:

Hi!

after upgrading to OPENEMR 4 the Greek characters in document attachments do not appear, there is just a straight line and if any the Latin characters.
Documents’ names uploaded using OpenEMR 3 are still shown ok.

Thank you again,
Evgenios

bradymiller wrote on Wednesday, May 30, 2012:

Hi Evgenios,

From what OpenEMR version did you upgrade from and how did you do the upgrade?

-brady
OpenEMR

anonymous wrote on Thursday, May 31, 2012:

Dear Brady,

hello and thank you again.

I have upgraded from 3.2 to 4.0 and then to 4.1.
The problem appeared after upgrading to 4.0.
If i remember correct, i just downloaded the .deb package and installed it (more or less these are the wiki instructions i think). 

I will try a fresh installation in an another pc and let you know.

Regards,
Evgenios

bradymiller wrote on Thursday, May 31, 2012:

Hi Evgenios,

I have confirmed this error (is actually a pretty nasty error). Quick question, are the document names that worked with greek names in version 3.2 showing up correctly?

I am pretty confident the issue here lies in functions that avoid illegal characters in the filenames. For example, the following line in the master/controllers/C_Document.class.php script:

$fname = preg_replace("/[^a-zA-Z0-9_.]/","_",$fname);

(note there are four instances of this type of command in this script)

My suggestion is to make one function that works:
1. Supports UTF8 characters
2. Also does not allow directory walking

And then modularize that function and place it in the library/sanitize.inc.php, so can also utilize it in other places. Any takers?

-brady
OpenEMR

anonymous wrote on Thursday, May 31, 2012:

I installed openemr in a fresh Ubuntu 12.04.
First i used 4.1 and had the same problems, both the collation and the Greek characters in attachments.
I uninstalled and installed 3.2. Both problems were gone.

The point is that this problem (Greek in attachments) appeared after upgrading, some  months ago, the collation problem appeared after upgrading Ubuntu.

Thank you

anonymous wrote on Thursday, May 31, 2012:

I posted before  i saw your posts and rushed.

No, at a closer look they do not look ok after all in OpenEMR 3.2. There is a strange behavior.
OpenEMR adds the date that the doc was uploaded in front of the doc name and it deletes the first Greek characters up to the file name or up to the underscore. If the first chars are Latin it just adds the date.

If the name is lets say “Ευγένιος_Μεταξας_FVC.pdf”
After uploading it becomes “2012-05-31 _Μεταξας_FVC.pdf”

If it is “Μεταξας_FVC.pdf” it becomes “2012-05-31 _FVC.pdf”

but if it is “Something_Latin_Μεταξας_FVC.pdf” it becomes "2012-05-31 _Something_Latin_Μεταξας_FVC.pdf "

All this in Ubuntu 12.04 & OpenEMR 3.2

https://www.dropbox.com/s/tjln7xin1beqf2m/Screenshot%20from%202012-05-31%2014_47_04.png

Thank you!