?
avatar bembelimen
bembelimen
13 Aug 2018

Steps to reproduce the issue

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?

avatar bembelimen bembelimen - open - 13 Aug 2018
avatar joomla-cms-bot joomla-cms-bot - change - 13 Aug 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 Aug 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 13 Aug 2018
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 13 Aug 2018
Category com_installer
avatar brianteeman
brianteeman - comment - 13 Aug 2018

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

avatar brianteeman brianteeman - change - 13 Aug 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-08-13 09:12:52
Closed_By brianteeman
avatar brianteeman brianteeman - close - 13 Aug 2018
avatar brianteeman
brianteeman - comment - 13 Aug 2018

See #21583

Add a Comment

Login with GitHub to post a comment