]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/newnotice.php
generate an etag for shownotice
[quix0rs-gnu-social.git] / actions / newnotice.php
index 3c9c499c237fbed09857beea50ad4cb5def2e90e..932099c605ef2c5265118ccce970fe762da4f767 100644 (file)
@@ -51,11 +51,11 @@ class NewnoticeAction extends Action {
                        $this->show_form(_('No content!'));
                        return;
                } else {
-                       $content = common_shorten_links($content);
+                       $content_shortened = common_shorten_links($content);
 
-                       if (mb_strlen($content) > 140) {
-                               common_debug("Content = '$content'", __FILE__);
-                               common_debug("mb_strlen(\$content) = " . mb_strlen($content), __FILE__);
+                       if (mb_strlen($content_shortened) > 140) {
+                               common_debug("Content = '$content_shortened'", __FILE__);
+                               common_debug("mb_strlen(\$content) = " . mb_strlen($content_shortened), __FILE__);
                                $this->show_form(_('That\'s too long. Max notice size is 140 chars.'));
                                return;
                        }
@@ -63,7 +63,7 @@ class NewnoticeAction extends Action {
 
                $inter = new CommandInterpreter();
 
-               $cmd = $inter->handle_command($user, $content);
+               $cmd = $inter->handle_command($user, $content_shortened);
 
                if ($cmd) {
                        $cmd->execute(new WebChannel());
@@ -72,8 +72,6 @@ class NewnoticeAction extends Action {
 
                $replyto = $this->trimmed('inreplyto');
 
-               common_debug("Replyto = $replyto\n");
-
                $notice = Notice::saveNew($user->id, $content, 'web', 1, ($replyto == 'false') ? NULL : $replyto);
 
                if (is_string($notice)) {
@@ -84,7 +82,7 @@ class NewnoticeAction extends Action {
                common_broadcast_notice($notice);
 
                if ($this->boolean('ajax')) {
-                       common_start_html('text/xml;charset=utf-8');
+                       common_start_html('text/xml;charset=utf-8', false);
                        common_element_start('head');
                        common_element('title', null, _('Notice posted'));
                        common_element_end('head');
@@ -107,7 +105,7 @@ class NewnoticeAction extends Action {
        }
 
        function ajax_error_msg($msg) {
-               common_start_html('text/xml;charset=utf-8');
+               common_start_html('text/xml;charset=utf-8', false);
                common_element_start('head');
                common_element('title', null, _('Ajax Error'));
                common_element_end('head');