forked from GNUsocial/gnu-social
register checks Profile bio length correctly
This commit is contained in:
parent
d51d83434d
commit
2b30d7fffb
@ -207,8 +207,9 @@ class RegisterAction extends Action
|
|||||||
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
|
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
|
||||||
$this->showForm(_('Full name is too long (max 255 chars).'));
|
$this->showForm(_('Full name is too long (max 255 chars).'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($bio) && mb_strlen($bio) > 140) {
|
} else if (Profile::bioTooLong($bio)) {
|
||||||
$this->showForm(_('Bio is too long (max 140 chars).'));
|
$this->showForm(sprintf(_('Bio is too long (max %d chars).'),
|
||||||
|
Profile::maxBio()));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($location) && mb_strlen($location) > 255) {
|
} else if (!is_null($location) && mb_strlen($location) > 255) {
|
||||||
$this->showForm(_('Location is too long (max 255 chars).'));
|
$this->showForm(_('Location is too long (max 255 chars).'));
|
||||||
@ -445,10 +446,16 @@ class RegisterAction extends Action
|
|||||||
'or profile on another site'));
|
'or profile on another site'));
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
|
$maxBio = Profile::maxBio();
|
||||||
|
if ($maxBio > 0) {
|
||||||
|
$bioInstr = sprintf(_('Describe yourself and your interests in %d chars'),
|
||||||
|
$maxBio);
|
||||||
|
} else {
|
||||||
|
$bioInstr = _('Describe yourself and your interests');
|
||||||
|
}
|
||||||
$this->textarea('bio', _('Bio'),
|
$this->textarea('bio', _('Bio'),
|
||||||
$this->trimmed('bio'),
|
$this->trimmed('bio'),
|
||||||
_('Describe yourself and your '.
|
$bioInstr);
|
||||||
'interests in 140 chars'));
|
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
$this->input('location', _('Location'),
|
$this->input('location', _('Location'),
|
||||||
|
Loading…
Reference in New Issue
Block a user