diff options
Diffstat (limited to 'classes/Message.php')
-rw-r--r-- | classes/Message.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/classes/Message.php b/classes/Message.php index 71362d9b7..979e6e87c 100644 --- a/classes/Message.php +++ b/classes/Message.php @@ -67,4 +67,20 @@ class Message extends Memcached_DataObject return $msg; } + + static function maxContent() + { + $desclimit = common_config('message', 'contentlimit'); + // null => use global limit (distinct from 0!) + if (is_null($desclimit)) { + $desclimit = common_config('site', 'textlimit'); + } + return $desclimit; + } + + static function contentTooLong($content) + { + $contentlimit = self::maxContent(); + return ($contentlimit > 0 && !empty($content) && (mb_strlen($content) > $contentlimit)); + } } |