Bug #7969

Database check in installation step4 modify database name

Added by Nicolas Ducoulombier almost 7 years ago. Updated almost 7 years ago.

Bug resolved
Installation / Migration
Target version:
Start date:
Due date:
% Done:


Estimated time:
Spent time:
SCRUM pts - complexity:


On step 4 of the installation process, when you enter a database name incluying the caracter "_" when you click on the "check database connection" button, the check is correct but when presenting the form again the field Main Chamilo database (DB) is modified, the caracter "_" is replaced by "-" so if you continue the installation fails and block on step 7 without indicating any error.

Related issues

Related to Chamilo LMS - Feature #3266: solution report again , "Sorry, you are not allowed to access "admin setting pageBug resolved15/04/2011




Updated by Nicolas Ducoulombier almost 7 years ago

  • Status changed from Assigned to Needs more info
  • Assignee changed from Nicolas Ducoulombier to Yannick Warnier
  • % Done changed from 0 to 50

The problem is in main/install/install.lib.php on line 1389 with the call of api_replace_dangerous_char

<div class="form-group">
//Database Name fix replace weird chars
if ($installType != INSTALL_TYPE_UPDATE) {
$dbNameForm = str_replace(array('-','*', '$', ' ', '.'), '', $dbNameForm);
$dbNameForm = api_replace_dangerous_char($dbNameForm);

I don't know why it is considered as a dangerous caracter and it's a problem because some hosting platforms have their naming rule such as "account_name" to name the database.

It is only called when charging the form, so only if we ask for verification of the connection.

Should the restriction be kept or not ?


Updated by Yannick Warnier almost 7 years ago

  • Status changed from Needs more info to Assigned
  • Assignee changed from Yannick Warnier to Nicolas Ducoulombier

We can remove the conversion. If it's not affected when not testing the database connection, then there's no point in changing it when you are testing the connection.


Updated by Nicolas Ducoulombier almost 7 years ago

  • % Done changed from 50 to 90

In task #3266 there was problem with Mysql Special characters such as "-" so I left the first modification even if it only applies when checking the database and only removed the dangerous character check:

commit 557a9babe58505dff3ddbb54538ff689a5d667fc
Author: Nicolas Ducoulombier <>
Date:   Fri Nov 20 10:22:40 2015 +0100

    not removing '_' and dangerous characters in the database name check in step 4 of install form but still checking Mysql special characters required in CT3266 -refs CT7969

Updated by Yannick Warnier almost 7 years ago

  • Category set to Installation / Migration
  • Status changed from Assigned to Bug resolved
  • % Done changed from 90 to 100


Also available in: Atom PDF