From: x99bachelart Date: Tue, 9 Sep 2003 15:24:22 +0000 (+0000) Subject: escapes '\n.\n' in body + custom css classes X-Git-Tag: 1.8~419 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=4ea94c33c73b9ae91b7ca1c901c0c6fbb14f1f47;p=banana.git escapes '\n.\n' in body + custom css classes --- diff --git a/thread.php b/thread.php index 026d8e9..f289fc0 100644 --- a/thread.php +++ b/thread.php @@ -95,15 +95,17 @@ if (isset($_REQUEST['action']) && (isset($_REQUEST['type']))) { } break; case 'new': + $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",stripslashes($_REQUEST['body'])); $message = 'From: '.$profile['name']."\n" ."Newsgroups: ".stripslashes(str_replace(" ","", $_REQUEST['newsgroups']))."\n" ."Subject: ".stripslashes($_REQUEST['subject'])."\n" + .(isset($profile['org'])?"Organization: ".$profile['org']."\n":"") .($_REQUEST['followup']!=''?'Followup-To: ' .stripslashes($_REQUEST['followup'])."\n":"") .$news['customhdr'] ."\n" - .wrap(stripslashes($_REQUEST['body']),"",$news['wrap']); + .wrap($body,"",$news['wrap']); $result = $mynntp->post($message); if ($result) { $text="

".$locale['post']['posted']."

"; @@ -115,18 +117,21 @@ if (isset($_REQUEST['action']) && (isset($_REQUEST['type']))) { $rq=$mynntp->group($group); $post = new post($mynntp,$id); if ($post) { - $refs = $post->headers->references." ".$post->headers->msgid; + $refs = (isset($post->headers->references)? + $post->headers->references." ":"").$post->headers->msgid; } + $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",stripslashes($_REQUEST['body'])); $message = 'From: '.$profile['name']."\n" ."Newsgroups: ".stripslashes($_REQUEST['newsgroups'])."\n" ."Subject: ".stripslashes($_REQUEST['subject'])."\n" + .(isset($profile['org'])?"Organization: ".$profile['org']."\n":"") .($_REQUEST['followup']!=''?'Followup-To: ' .stripslashes($_REQUEST['followup'])."\n":"") ."References: $refs\n" .$news['customhdr'] ."\n" - .wrap(stripslashes($_REQUEST['body']),"",$news['wrap']); + .wrap($body,"",$news['wrap']); $result = $mynntp->post($message); if ($result) { $text="

".$locale['post']['posted']."

"; @@ -146,7 +151,7 @@ if (isset($_REQUEST['action']) && (isset($_REQUEST['type']))) { ?> -
+
@@ -158,16 +163,16 @@ displayshortcuts(); ?> - - - -
+ + +