We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 7b30e3c0 authored by Craig Andrews's avatar Craig Andrews

Shorten the notice text after command processing is done

parent 922ee7b3
......@@ -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...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment