]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
can set group desc limit to unlimited without resetting global limit
authorEvan Prodromou <evan@controlyourself.ca>
Fri, 21 Aug 2009 10:36:55 +0000 (06:36 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Fri, 21 Aug 2009 10:36:55 +0000 (06:36 -0400)
classes/User_group.php

index 38e0058c136b49b67d76b3217c6dd5c26e774da6..e6e79ca6a3daa066c7e253d2124bea8a86d64917 100644 (file)
@@ -301,7 +301,8 @@ class User_group extends Memcached_DataObject
     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;
@@ -310,6 +311,6 @@ class User_group extends Memcached_DataObject
     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));
     }
 }