]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
trac31 shorten all URLs even if notice is already <
authormillette <millette@controlyourself.ca>
Thu, 13 Nov 2008 15:32:16 +0000 (10:32 -0500)
committermillette <millette@controlyourself.ca>
Thu, 13 Nov 2008 15:32:16 +0000 (10:32 -0500)
darcs-hash:20081113153216-099f7-81c4aba01babca97edeaf55b230dee300dbeb57a.gz

actions/newmessage.php
actions/newnotice.php
actions/postnotice.php

index 2455f42e947959fb40f5cd07ba4bf4d78b3aa5c0..d4e289465aa066b50a871e23e4170d1023492c53 100644 (file)
@@ -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) {
index 8ea47b235ba8d956bffedd3f2945811098764dfa..e88da16876f9b091ec1dd9f97608ae11e1a6365f 100644 (file)
@@ -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) {
index b4a272e6182c8e2b2874eb60dc8dba13fabe335d..243aa31633f172ef62b16a7ffe1d59ba99b9d723 100644 (file)
@@ -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)) {