}
function save_new_message() {
-
$user = common_current_user();
assert($user); # XXX: maybe an error instead...
if (!$content) {
$this->show_form(_('No content!'));
return;
- } else if (mb_strlen($content) > 140) {
-
+// } else if (mb_strlen($content) > 140) {
+ } else {
$content = common_shorten_links($content);
if (mb_strlen($content) > 140) {
function save_new_notice() {
- # CSRF protection - token set in common_notice_form()
- $token = $this->trimmed('token');
- if (!$token || $token != common_session_token()) {
- $this->client_error(_('There was a problem with your session token. Try again, please.'));
- return;
- }
-
$user = common_current_user();
assert($user); # XXX: maybe an error instead...
$content = $this->trimmed('status_textarea');
if (!$content) {
$this->show_form(_('No content!'));
return;
- } else if (mb_strlen($content) > 140) {
-
+// } else if (mb_strlen($content) > 140) {
+ } else {
$content = common_shorten_links($content);
if (mb_strlen($content) > 140) {
return false;
}
$content = $req->get_parameter('omb_notice_content');
- if (!$content || strlen($content) > 140) {
+// if (!$content || strlen($content) > 140) {
$content = common_shorten_links($content);
if (mb_strlen($content) > 140) {
common_user_error(_('Invalid notice content'), 400);
return false;
}
- }
+// }
$notice_uri = $req->get_parameter('omb_notice');
if (!Validate::uri($notice_uri) &&
!common_valid_tag($notice_uri)) {