From 7b30e3c00f9fea529ee71a9783006956960ca5e2 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Tue, 27 Oct 2009 22:02:55 -0400 Subject: [PATCH] Shorten the notice text after command processing is done --- actions/newnotice.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/actions/newnotice.php b/actions/newnotice.php index 9ee031f936..fe7df09382 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -160,18 +160,12 @@ class NewnoticeAction extends Action if (!$content) { $this->clientError(_('No content!')); - } else { - $content_shortened = common_shorten_links($content); - if (Notice::contentTooLong($content_shortened)) { - $this->clientError(sprintf(_('That\'s too long. '. - 'Max notice size is %d chars.'), - Notice::maxContent())); - } + return; } $inter = new CommandInterpreter(); - $cmd = $inter->handle_command($user, $content_shortened); + $cmd = $inter->handle_command($user, $content); if ($cmd) { if ($this->boolean('ajax')) { @@ -182,6 +176,13 @@ class NewnoticeAction extends Action return; } + $content_shortened = common_shorten_links($content); + if (Notice::contentTooLong($content_shortened)) { + $this->clientError(sprintf(_('That\'s too long. '. + 'Max notice size is %d chars.'), + Notice::maxContent())); + } + $replyto = $this->trimmed('inreplyto'); #If an ID of 0 is wrongly passed here, it will cause a database error, #so override it... -- 2.39.2