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

Commit 5fc9f116 authored by millette's avatar millette

trac31 shorten all URLs even if notice is already <

darcs-hash:20081113153216-099f7-81c4aba01babca97edeaf55b230dee300dbeb57a.gz
parent 14f69f8d
......@@ -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) {
......
......@@ -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) {
......
......@@ -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)) {
......
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