From: Craig Andrews Date: Wed, 28 Oct 2009 02:02:55 +0000 (-0400) Subject: Shorten the notice text after command processing is done X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7b30e3c00f9fea529ee71a9783006956960ca5e2;p=quix0rs-gnu-social.git Shorten the notice text after command processing is done --- 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...