*FIX* for MaxLength of Name and Username

12 years 1 week ago #80407 by TBZ
Hi, I'm not too sure where to post this, but after really needing a maxlength for names and usernames, I found (along with my buddy Trevor) and made the following fix.
Starting at Line 925 of plugin.class.php

[code:1]
// Maximum field length:
if ( $field->name == 'username' ) {
$defaultMax = 12;
} elseif ( $field->name == 'name' ) {
$defaultMax = 12;
}
$fieldMaxLength = $field->params->get( 'fieldMaxLength', $defaultMax );

if ( $fieldMaxLength && ( $len > $fieldMaxLength ) ) {
$this->_setValidationError( $field, $user, $reason, sprintf( _UE_VALID_MAX_LENGTH, $this->getFieldTitle( $field, $user, 'text', $reason ), $fieldMaxLength, $len ) );
return false;
}[/code:1]

I hope this helps others as I did search for and couldn't find a fix on here regarding it.


Thanks.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.367 seconds

Facebook Twitter LinkedIn