summaryrefslogtreecommitdiff
path: root/actions/newmessage.php
diff options
context:
space:
mode:
authormillette <millette@controlyourself.ca>2008-11-06 15:59:26 -0500
committermillette <millette@controlyourself.ca>2008-11-06 15:59:26 -0500
commit15c1d4f5e4947b9c60439ab5a17694ad57d06704 (patch)
tree4139f40409a3765a9a4dbf4b6922fd7232f43441 /actions/newmessage.php
parent1e8d26baecad6ca1088ea7815fe2615fb520a10e (diff)
trac31 url_auto_shortening by sgmurphy
darcs-hash:20081106205926-099f7-6bcfd7969a159a12b1ba6a9ee254e44a07b94761.gz
Diffstat (limited to 'actions/newmessage.php')
-rw-r--r--actions/newmessage.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/actions/newmessage.php b/actions/newmessage.php
index 7dce97d20..2455f42e9 100644
--- a/actions/newmessage.php
+++ b/actions/newmessage.php
@@ -53,10 +53,15 @@ class NewmessageAction extends Action {
$this->show_form(_('No content!'));
return;
} else if (mb_strlen($content) > 140) {
- common_debug("Content = '$content'", __FILE__);
- common_debug("mb_strlen(\$content) = " . mb_strlen($content), __FILE__);
- $this->show_form(_('That\'s too long. Max message size is 140 chars.'));
- return;
+
+ $content = common_shorten_links($content);
+
+ if (mb_strlen($content) > 140) {
+ common_debug("Content = '$content'", __FILE__);
+ common_debug("mb_strlen(\$content) = " . mb_strlen($content), __FILE__);
+ $this->show_form(_('That\'s too long. Max message size is 140 chars.'));
+ return;
+ }
}
$other = User::staticGet('id', $to);