Project

General

Profile

Bug #700

Add dangerous char + & % ; in fct replace_dangerous_char

Added by Hubert Borderiou over 9 years ago. Updated over 9 years ago.

Status:
Feature implemented
Priority:
Normal
Category:
-
Target version:
Start date:
11/03/2010
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Hi,

My configuration :
chamilo 1.8.6.2
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...)

Anyway...

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 (http://support.chamilo.org/projects/chamilo-18/repository/revisions/7213/diff/main/inc/lib/main_api.lib.php) 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.

History

#1

Updated by Ivan Tcholakov over 9 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.

#2

Updated by Ivan Tcholakov over 9 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.
http://code.google.com/p/chamilo/source/detail?r=77f3fc5bf108d6876d39b4fa8dc6e62bc0583a0c&repo=classic

Thank you, this report was important.

#3

Updated by Ivan Tcholakov over 9 years ago

  • Status changed from Assigned to Feature implemented

Also available in: Atom PDF