Bug #700

Add dangerous char + & % ; in fct replace_dangerous_char

Added by Hubert Borderiou about 10 years ago. Updated about 10 years ago.

Feature implemented
Ivan Tcholakov
Target version:
Start date:
Due date:
% Done:


Estimated time:
SCRUM pts - complexity:



My configuration :
Use human readable document title = yes
OS = linux

I have error when creating document or folder using characters + & % ;
I have an error too when creatong folders using these char with the Assignments Tool
I had these characters in fonction function replace_dangerous_char $search array

For char > , it is replace with the html entity in filename... that's quite weird, but it's ok, if you forbid char & and ;

If you use < on filename, every char after < disapear, but there is no error, you can read the file. You can name your file using < if you want to have < on your title... (It doesnt behave the same way, if you prevent using "human name" in configuration...)


it may be a good idea to prevent the use of chars + & % ;
and add these chars in function replace_dangerous_char in file inc.lib/main_api_lib.php

I've check there is already a modification to this file ( but it doesn't impact.

For compatibility, if, in Chamilo, before this patch, I have created a file named one+one, I couldn' display it, but I could edit it.
After the patch, it is the same thing, I cannot display it, but I can edit it... but I can delete it.

I've quickly checked where this fonction is used (grep -r "replace_dangerous_char" *) and it "looks" fine, I didn't test it in a exhausti ve way. I'll use this patch in my Chamilo, because teachers had trouble with these chars.



Updated by Ivan Tcholakov about 10 years ago

  • Status changed from New to Assigned
  • Assignee set to Ivan Tcholakov
  • Target version set to 1.8.7 beta

I am taking this task.


Updated by Ivan Tcholakov about 10 years ago

  • % Done changed from 0 to 100

10850:77f3fc5bf108 Bug #700 - Reworks for the function replace_dangerous_char():
1. The list of dangerous characters has been increased;
2. Possible html-entities are converted into normal characters before the replacements;
3. When long file name is cut to the limited size, the file extension is not lost.

Thank you, this report was important.


Updated by Ivan Tcholakov about 10 years ago

  • Status changed from Assigned to Feature implemented

Also available in: Atom PDF