diff options
author | millette <millette@controlyourself.ca> | 2008-11-13 10:32:16 -0500 |
---|---|---|
committer | millette <millette@controlyourself.ca> | 2008-11-13 10:32:16 -0500 |
commit | 5fc9f116776164da15cf6e927849e68f6515cdb9 (patch) | |
tree | 2dda4ffc8bed10a21e57ddcc7e1651a6f10f7b9e /actions | |
parent | 14f69f8d2efee5a927821c9a3c134cd1a682c7fe (diff) |
trac31 shorten all URLs even if notice is already <
darcs-hash:20081113153216-099f7-81c4aba01babca97edeaf55b230dee300dbeb57a.gz
Diffstat (limited to 'actions')
-rw-r--r-- | actions/newmessage.php | 5 | ||||
-rw-r--r-- | actions/newnotice.php | 11 | ||||
-rw-r--r-- | actions/postnotice.php | 4 |
3 files changed, 6 insertions, 14 deletions
diff --git a/actions/newmessage.php b/actions/newmessage.php index 2455f42e9..d4e289465 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,8 +51,8 @@ class NewmessageAction extends Action { 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) { diff --git a/actions/newnotice.php b/actions/newnotice.php index 8ea47b235..e88da1687 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -36,13 +36,6 @@ class NewnoticeAction extends Action { 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'); @@ -50,8 +43,8 @@ class NewnoticeAction extends Action { 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) { diff --git a/actions/postnotice.php b/actions/postnotice.php index b4a272e61..243aa3163 100644 --- a/actions/postnotice.php +++ b/actions/postnotice.php @@ -58,13 +58,13 @@ class PostnoticeAction extends Action { 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)) { |