Skip to content

Conversation

alikon
Copy link
Contributor

@alikon alikon commented Sep 26, 2025

Pull Request for Issue #46111, #42289 .

Summary of Changes

Admin password must be at least 12 characters long and not contains spaces

Testing Instructions

Install Joomla 5.3.x
At Login Data: set a short <12 char and or use spaces as 'Set the username for your Super User account. *'

Actual result BEFORE applying this Pull Request

The installation process goes on until it gets stuck in the 'Installation progress' phase. There is no possibility to cancel, stop or do something other than go back in the browser.

Expected result AFTER applying this Pull Request

you cannot proceed untill you set a minimum password of 12 chars and without spaces
image

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@tecpromotion
Copy link
Contributor

@alikon Please do not use hard-coded strings. This should be a variable so that appropriate translations can be made in all languages.

@alikon alikon added the bug label Sep 26, 2025
@alikon
Copy link
Contributor Author

alikon commented Sep 26, 2025

@tecpromotion no more hard-coded strings

@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on 65a2286


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46173.

@tecpromotion
Copy link
Contributor

Does it make sense to check for invalid characters here as well, or do we need a new PR for that?
I just entered four letters and the rest as spaces. The bar turns green and at the very end, an error message appears saying that the password must not contain any spaces, and nothing works anymore.

Screenshot in german but you see the problem.
Bildschirmfoto 2025-09-26 um 11 08 33

@alikon
Copy link
Contributor Author

alikon commented Sep 26, 2025

the only chars that is been checked on installation should be spaces, check added

@tecpromotion
Copy link
Contributor

It works in principle, but the string JFIELD_PASSWORD_SPACES_IN_PASSWORD is not entirely correct, as spaces within the password are not accepted either. However, it only refers to the beginning and end.

@alikon
Copy link
Contributor Author

alikon commented Sep 26, 2025

then the text of JFIELD_PASSWORD_SPACES_IN_PASSWORD="Password must not have spaces at the beginning or end." is wrong

as it is only used here

$valueLength = \strlen($value);
// We set a maximum length to prevent abuse since it is unfiltered.
if ($valueLength > 4096) {
Factory::getApplication()->enqueueMessage(Text::_('JFIELD_PASSWORD_TOO_LONG'), 'error');
}
// We don't allow white space inside passwords
$valueTrim = trim($value);
// Set a variable to check if any errors are made in password
$validPassword = true;
if (\strlen($valueTrim) !== $valueLength) {
Factory::getApplication()->enqueueMessage(
Text::_('JFIELD_PASSWORD_SPACES_IN_PASSWORD'),
'error'
);
$validPassword = false;
}

it should be JFIELD_PASSWORD_SPACES_IN_PASSWORD="Password must not have spaces."

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

Successfully merging this pull request may close these issues.

5 participants