$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;
}
$inter = new CommandInterpreter();
- $cmd = $inter->handle_command($user, $content);
+ $cmd = $inter->handle_command($user, $content_shortened);
if ($cmd) {
$cmd->execute(new WebChannel());
$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)) {
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');
}
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');