summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-10-27 22:02:55 -0400
committerCraig Andrews <candrews@integralblue.com>2009-10-27 22:02:55 -0400
commit7b30e3c00f9fea529ee71a9783006956960ca5e2 (patch)
treef5cf648f4b53a10d0b0f98417be7e74807fc5f38
parent922ee7b3b292689806b0b94a9eb94fe08a204751 (diff)
Shorten the notice text after command processing is done
-rw-r--r--actions/newnotice.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php
index 9ee031f93..fe7df0938 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...