summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-12 09:47:57 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-12 09:47:57 -0700
commitce6285d0fc117c36716b9b3a74a11d1bfd4e45f3 (patch)
tree7a65095ca0a71b40a4bfaab2e829116ced870841
parent1a077b0a7fa699302d7ff2ff59feb118d5653c15 (diff)
push length check to Notice class
-rw-r--r--classes/Notice.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index b4c86ebeb..bca4b22c4 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -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.');