]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Shorten the notice text after command processing is done
authorCraig Andrews <candrews@integralblue.com>
Wed, 28 Oct 2009 02:02:55 +0000 (22:02 -0400)
committerCraig Andrews <candrews@integralblue.com>
Wed, 28 Oct 2009 02:02:55 +0000 (22:02 -0400)
actions/newnotice.php

index 9ee031f93636b0003f5ae6937c4bc9e892f64d48..fe7df0938275819effa189238edcfa6ca6e40627 100644 (file)
@@ -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...