summaryrefslogtreecommitdiff
path: root/actions/register.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-08-21 08:03:40 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-08-21 08:03:40 -0400
commit2b30d7fffb4deeee7d5391585692d76c59cd2ba9 (patch)
tree900286eef3f3e746c65a0e94b28921fd89405dbb /actions/register.php
parentd51d83434da53c0f30416e9b17cd25d61f554a68 (diff)
register checks Profile bio length correctly
Diffstat (limited to 'actions/register.php')
-rw-r--r--actions/register.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/actions/register.php b/actions/register.php
index dcbbbdb6a..ab04f18d5 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -207,8 +207,9 @@ class RegisterAction extends Action
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
$this->showForm(_('Full name is too long (max 255 chars).'));
return;
- } else if (!is_null($bio) && mb_strlen($bio) > 140) {
- $this->showForm(_('Bio is too long (max 140 chars).'));
+ } else if (Profile::bioTooLong($bio)) {
+ $this->showForm(sprintf(_('Bio is too long (max %d chars).'),
+ Profile::maxBio()));
return;
} else if (!is_null($location) && mb_strlen($location) > 255) {
$this->showForm(_('Location is too long (max 255 chars).'));
@@ -445,10 +446,16 @@ class RegisterAction extends Action
'or profile on another site'));
$this->elementEnd('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->trimmed('bio'),
- _('Describe yourself and your '.
- 'interests in 140 chars'));
+ $bioInstr);
$this->elementEnd('li');
$this->elementStart('li');
$this->input('location', _('Location'),