summaryrefslogtreecommitdiff
path: root/actions/profilesettings.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-08-21 07:48:30 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-08-21 07:48:30 -0400
commitd51d83434da53c0f30416e9b17cd25d61f554a68 (patch)
tree791d1f5950582b85b2e6ee76ef9c5be3e9103d87 /actions/profilesettings.php
parent4d3e2daf536c32d46fffb4defac7cbe89bdf3a1c (diff)
check and show max bio length in profilesettings
Diffstat (limited to 'actions/profilesettings.php')
-rw-r--r--actions/profilesettings.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/actions/profilesettings.php b/actions/profilesettings.php
index fb847680b..961e15ae7 100644
--- a/actions/profilesettings.php
+++ b/actions/profilesettings.php
@@ -109,9 +109,16 @@ class ProfilesettingsAction extends AccountSettingsAction
_('URL of your homepage, blog, 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->arg('bio')) ? $this->arg('bio') : $profile->bio,
- _('Describe yourself and your interests in 140 chars'));
+ $bioInstr);
$this->elementEnd('li');
$this->elementStart('li');
$this->input('location', _('Location'),
@@ -202,8 +209,9 @@ class ProfilesettingsAction extends AccountSettingsAction
} 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).'));