summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-08-21 07:40:46 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-08-21 07:40:46 -0400
commitd2d3418b8ae6986c14e8eda25779d621443e9e0a (patch)
tree83dedc2afec297df6dccc8c9c3c5d6ee04719b92 /classes
parent2b2541e4b4eae5dcdfc6c921e12ad8974b31f125 (diff)
Profile class has methods to check bio length
Diffstat (limited to 'classes')
-rw-r--r--classes/Profile.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/classes/Profile.php b/classes/Profile.php
index a34f4cf4b..ff233666a 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -460,4 +460,20 @@ class Profile extends Memcached_DataObject
$c->delete(common_cache_key('profile:notice_count:'.$this->id));
}
}
+
+ static function maxBio()
+ {
+ $biolimit = common_config('message', 'biolimit');
+ // null => use global limit (distinct from 0!)
+ if (is_null($biolimit)) {
+ $biolimit = common_config('site', 'textlimit');
+ }
+ return $biolimit;
+ }
+
+ static function bioTooLong($bio)
+ {
+ $biolimit = self::maxBio();
+ return ($biolimit > 0 && !empty($bio) && (mb_strlen($bio) > $biolimit));
+ }
}