Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Error message for database name in installation #21578

Closed
bembelimen opened this issue Aug 13, 2018 · 2 comments
Closed

[4.0] Error message for database name in installation #21578

bembelimen opened this issue Aug 13, 2018 · 2 comments

Comments

@bembelimen
Copy link
Contributor

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?

@brianteeman
Copy link
Contributor

brianteeman commented Aug 13, 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

@brianteeman
Copy link
Contributor

See #21583

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants