From: x2003bruneau Date: Sat, 13 Jan 2007 20:36:05 +0000 (+0000) Subject: Fix NNTP posting (double points on line beginning) X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=d759a2ba63588128669bb1ea255fd940b0340dd1;p=banana.git Fix NNTP posting (double points on line beginning) Fix // ** __ handling Fix message preview in cancel form git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@163 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index 0da49bd..c94af4b 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -429,7 +429,10 @@ class Banana $this->removeMessage($group, $artid); Banana::$page->redirect(Array('group' => $group, 'first' => $ndx)); } + Banana::$page->assign_by_ref('message', $msg); + Banana::$page->assign('body', $msg->getFormattedBody()); + Banana::$page->assign('headers', Banana::$msgshow_headers); return true; } diff --git a/banana/message.func.inc.php b/banana/message.func.inc.php index 0576e88..07d52f7 100644 --- a/banana/message.func.inc.php +++ b/banana/message.func.inc.php @@ -92,7 +92,7 @@ function banana_catchFormats($text) $text = str_replace($urls[0], "&&&urls&&&", $text); foreach ($formatting as $limit=>$mark) { $limit = preg_quote($limit, '/'); - $text = preg_replace('/' . $limit . '\b([-\w]+?)\b ' . $limit . '/us', + $text = preg_replace('/' . $limit . '(\S+?)' . $limit . '/us', "<$mark>\\1", $text); } return preg_replace('/&&&urls&&&/e', 'array_shift($urls[0])', $text); @@ -261,7 +261,7 @@ function banana_removeEvilAttributes($tagSource) function banana_cleanHtml($source) { $allowedTags = '



  • ' - . '

    '; + . '

    '; $source = strip_tags($source, $allowedTags); $source = preg_replace('/<(.*?)>/ie', "'<'.banana_removeEvilAttributes('\\1').'>'", $source); diff --git a/banana/nntpcore.inc.php b/banana/nntpcore.inc.php index 4fbe022..2d5434b 100644 --- a/banana/nntpcore.inc.php +++ b/banana/nntpcore.inc.php @@ -139,6 +139,7 @@ class BananaNNTPCore $message = join("\n", $_message); } if ($message) { + $message = preg_replace("/(^|\n)\./", '\1..', $message); $this->putLine("$message\r\n", false); } return $this->execLine('.');