From 15c1d4f5e4947b9c60439ab5a17694ad57d06704 Mon Sep 17 00:00:00 2001 From: millette Date: Thu, 6 Nov 2008 15:59:26 -0500 Subject: trac31 url_auto_shortening by sgmurphy darcs-hash:20081106205926-099f7-6bcfd7969a159a12b1ba6a9ee254e44a07b94761.gz --- actions/newnotice.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'actions/newnotice.php') diff --git a/actions/newnotice.php b/actions/newnotice.php index 37cca982d..8ea47b235 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -51,10 +51,15 @@ class NewnoticeAction 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 notice 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 notice size is 140 chars.')); + return; + } } $inter = new CommandInterpreter(); -- cgit v1.2.3-54-g00ecf