X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fnewmessage.php;h=d4e289465aa066b50a871e23e4170d1023492c53;hb=4f3d1e93e97365deac2366bfe422e8301d773a25;hp=25ce6c694d0a1c1b3ad0be7791db7bf372c710d3;hpb=fc7663e86ab7fd00cace6cfc80dee60b25c83bdc;p=quix0rs-gnu-social.git diff --git a/actions/newmessage.php b/actions/newmessage.php index 25ce6c694d..d4e289465a 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -34,7 +34,6 @@ class NewmessageAction extends Action { } function save_new_message() { - $user = common_current_user(); assert($user); # XXX: maybe an error instead... @@ -52,11 +51,16 @@ class NewmessageAction extends Action { if (!$content) { $this->show_form(_('No content!')); return; - } else if (mb_strlen($content) > 140) { - common_debug("Content = '$content'", __FILE__); - common_debug("mb_strlen(\$content) = " . mb_strlen($content), __FILE__); - $this->show_form(_('That\'s too long. Max message size is 140 chars.')); - return; +// } else if (mb_strlen($content) > 140) { + } else { + $content = common_shorten_links($content); + + if (mb_strlen($content) > 140) { + common_debug("Content = '$content'", __FILE__); + common_debug("mb_strlen(\$content) = " . mb_strlen($content), __FILE__); + $this->show_form(_('That\'s too long. Max message size is 140 chars.')); + return; + } } $other = User::staticGet('id', $to); @@ -81,8 +85,7 @@ class NewmessageAction extends Action { $this->notify($user, $other, $message); - $url = common_local_url('showmessage', - array('message' => $message->id)); + $url = common_local_url('outbox', array('nickname' => $user->nickname)); common_redirect($url, 303); }