Skip to content

Commit

Permalink
min username length adjusted
Browse files Browse the repository at this point in the history
  • Loading branch information
mxkmp29 authored and mxkmp29 committed Aug 12, 2016
1 parent 809f68a commit eaae746
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions administrator/components/com_users/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@
type="integer"
label="COM_USERS_CONFIG_FIELD_USERNAME_MINNUMCHARS_LABEL"
description="COM_USERS_CONFIG_FIELD_USERNAME_MINNUMCHARS_DESC"
first="0"
first="2"
last="99"
step="1"
default="0">
default="2">
</field>

<field
Expand Down
4 changes: 2 additions & 2 deletions libraries/joomla/form/rule/username.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
$usernameLength = StringHelper::strlen($value);

// Get the minimum number of characters
$minNumChars = $params->get('minimum_length_username', 0);
$minNumChars = $params->get('minimum_length_username', 2);

// If is set minNumChars and $usernameLength does't achieve minimum lenght
if (($minNumChars) && ($usernameLength < $minNumChars))
Expand All @@ -84,7 +84,7 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
// Get the maximum number of characters
$maxNumChars = $params->get('maximum_length_username', 0);

// If is set maxNumChars and $usernameLength surpass maximum lenght
// If is set maxNumChars and $usernameLength surpass maximum length
if (($maxNumChars) && ($usernameLength > $maxNumChars))
{
$app->enqueueMessage(JText::sprintf('JLIB_RULES_FIELD_USERNAME_MAXNUMCHARS_REQUIRED', $maxNumChars, $usernameLength), 'warning');
Expand Down

0 comments on commit eaae746

Please sign in to comment.