static function maxDescription()
{
$desclimit = common_config('group', 'desclimit');
- if (empty($desclimit)) {
+ // null => use global limit (distinct from 0!)
+ if (is_null($desclimit)) {
$desclimit = common_config('site', 'textlimit');
}
return $desclimit;
static function descriptionTooLong($desc)
{
$desclimit = self::maxDescription();
- return (!empty($desclimit) && !empty($desc) && (mb_strlen($desc) > $desclimit));
+ return ($desclimit > 0 && !empty($desc) && (mb_strlen($desc) > $desclimit));
}
}