forked from GNUsocial/gnu-social
Profile class has methods to check bio length
This commit is contained in:
parent
2b2541e4b4
commit
d2d3418b8a
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user