Start the installation and insert a database with an invalid character (like "-"). You get an error:
The database name is invalid. It must start with a letter, followed by alphanumeric characters.
.
Checking the code here https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/src/Model/DatabaseModel.php#L183-L188 and here: https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/src/Model/SetupModel.php#L320-L325 the regexp is: #^[a-zA-Z_][0-9a-zA-Z_$]*$#
means, a underscore is allowed, too as first char. Perhaps the error message should be changed (e.g. https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/language/en-GB/en-GB.ini#L62 )
The next question is: why is a normal dash not allowed?
Labels |
Added:
?
|
Status | New | ⇒ | Discussion |
Category | ⇒ | com_installer |
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-08-13 09:12:52 |
Closed_By | ⇒ | brianteeman |
Then the regex is wrong if it allows the _ and I will submit a pr for that
The dash is not allowed because it is not part of the specification from mysql - it may work but it is known to cause problems just as starting with a number may do