Merge branch 'develop' of github.com:humhub/humhub into develop

This commit is contained in:
HumHub Translations 2021-02-04 13:54:11 +01:00
commit a1afe047b2
2 changed files with 4 additions and 1 deletions

View File

@ -42,3 +42,4 @@
- Enh #4671: Implemented live poll result sharing by BroadCastChannel
- Enh #4829: Renamed account "Security" page and make it optional
- Enh #4818: Added database related checks (Driver, Collation, Table Engine)
- Fix #4831: Validate username by pattern only on change or for new users

View File

@ -150,7 +150,9 @@ class User extends ContentContainerActiveRecord implements IdentityInterface, Se
[['username'], 'unique'],
[['username'], 'string', 'max' => $userModule->maximumUsernameLength, 'min' => $userModule->minimumUsernameLength],
// Client validation is disable due to invalid client pattern validation
[['username'], 'match', 'pattern' => $userModule->validUsernameRegexp, 'message' => Yii::t('UserModule.base', 'Username contains invalid characters.'), 'enableClientValidation' => false],
[['username'], 'match', 'pattern' => $userModule->validUsernameRegexp, 'message' => Yii::t('UserModule.base', 'Username contains invalid characters.'), 'enableClientValidation' => false, 'when' => function ($model, $attribute) {
return $model->getAttribute($attribute) !== $model->getOldAttribute($attribute);
}],
[['status', 'created_by', 'updated_by', 'visibility'], 'integer'],
[['tags'], 'string'],
[['guid'], 'string', 'max' => 45],