Page 1 of 1

Bug with ' (=&#39) in filename?

PostPosted:Thu Aug 03, 2017 7:36 pm
by stefano.bortolato
Hi all.
I made a new installation in CentOS 7.3. When I upload a file the name has " ' " (=&#39) I will have an error 015 after upload. The file is not deleted (and usable). An example name with the problem is "Test'1.doc".

Well. I have a CentOS 7.3, backend database MariaDB 15.1, Java Oracle 1.8.0_144, OpenKM 6.3.4 CE under Tomcat 7.0.61 with UTF-8 URI encoding enabled (under Tomcat and OpenKM configuration).
I have the problem with the bundle package and the OKMinstaller.jar.
On the log I find an error like the "error ../Test&#391.doc not found" (I'm sorry, but I deleted the log).
At the moment I made a work-around to extended the "restrict.file.name" (in the Administration->Configuration) with the value "*~;*.bak;*&#39*;".
I have no problem with other special characters (like °, §, è, ç, etc...).

Anybody know anyting about this problem?

Thanks in advance.

Re: Bug with ' (=&#39) in filename?

PostPosted:Sat Aug 05, 2017 5:18 pm
by jllort
The issue might have relation with something we have on discusion last 2 years. Actually we change some characters from server side before storing. WE started doing it to make compatible download etc... between different OS etc.. but nowdays we are not sure had been a good idea do not preserve original name and make some workaround at upper level. Anyway going to your question it seems a bug.

Here two options:
1- Create an issue here : https://github.com/openkm/document-management-system
2- Try to correct yourselft ( I can guide you on the classes involved ):
DBDocumentModule.java line 129
Code: Select all
name = PathUtils.escape(name);
I think the character should be encoded and now we are not doing, should check database value with:
Code: Select all
SELECT * FROM OKM_NODE_BASE WHERE NBS_UUID='get the document uuiud from properties view'