]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
push length check to Notice class
authorEvan Prodromou <evan@controlyourself.ca>
Fri, 12 Jun 2009 16:47:57 +0000 (09:47 -0700)
committerEvan Prodromou <evan@controlyourself.ca>
Fri, 12 Jun 2009 16:47:57 +0000 (09:47 -0700)
classes/Notice.php

index b4c86ebeb5ba093366230d1d35d00b84e69b91eb..bca4b22c4c76c73e45f1e84fa659c2fb3f98389a 100644 (file)
@@ -123,7 +123,12 @@ class Notice extends Memcached_DataObject
 
         $profile = Profile::staticGet($profile_id);
 
-        $final =  common_shorten_links($content);
+        $final = common_shorten_links($content);
+
+        if (mb_strlen($final) > 140) {
+            common_log(LOG_INFO, 'Rejecting notice that is too long.');
+            return _('Problem saving notice. Too long.');
+        }
 
         if (!$profile) {
             common_log(LOG_ERR, 'Problem saving notice. Unknown user.');