wibble
authorx2000habouzit <x2000habouzit>
Sun, 2 Jan 2005 21:01:08 +0000 (21:01 +0000)
committerx2000habouzit <x2000habouzit>
Sun, 2 Jan 2005 21:01:08 +0000 (21:01 +0000)
bug with spool refresh though :(

include/spool.inc.php
thread.php

index 72d8a62..8fba366 100644 (file)
@@ -8,7 +8,8 @@
 ********************************************************************************/
 
 if(!function_exists('_file_put_contents')) {
-    function file_put_contents($filename, $data) {
+    function file_put_contents($filename, $data)
+    {
         $fp = fopen($filename, 'w');
         if(!$fp) {
             trigger_error('file_put_contents cannot write in file '.$filename, E_USER_ERROR);
@@ -187,7 +188,8 @@ class BananaSpool
         }
     }
 
-    function _updateUnread(&$nntp, $since, $mode) {
+    function _updateUnread(&$nntp, $since, $mode)
+    {
         if (empty($since)) { return; }
 
         if (is_array($newpostsids = $nntp->newnews($since, $this->group))) {
@@ -283,7 +285,8 @@ class BananaSpool
      * @param $_head BOOLEAN true if first post in thread
      */
 
-    function _disp_desc($_id, $_index, $_first=0, $_last=0, $_ref="", $_pfx_node="", $_pfx_end="", $_head=true) {
+    function _disp_desc($_id, $_index, $_first=0, $_last=0, $_ref="", $_pfx_node="", $_pfx_end="", $_head=true)
+    {
         global $css;
         $spfx_f   = '<img src="img/k1.gif" height="21" width="9" alt="o" />'; 
         $spfx_n   = '<img src="img/k2.gif" height="21" width="9" alt="*" />'; 
@@ -345,7 +348,8 @@ class BananaSpool
      * @param $_ref STRING MSGNUM of current/selectionned post
      */
 
-    function disp($_first=0, $_last=0, $_ref="") {
+    function disp($_first=0, $_last=0, $_ref="")
+    {
         global $css;
         $index = 1;
         if (sizeof($this->overview)) {
@@ -368,7 +372,8 @@ class BananaSpool
      * @return INTEGER linear index of post
      */
 
-    function getndx($_id) {
+    function getndx($_id)
+    {
         $ndx    = 1;
         $id_cur = $_id;
         while (true) {
index 8eeee78..4f9e53b 100644 (file)
@@ -38,8 +38,7 @@ if ($news['user']!="anonymous") {
   $result = $nntp->authinfo($news["user"],$news["pass"]);
   if (!$result) error("nntpauth");
 }
-$spool = new BananaSpool($nntp,$group,$profile['display'],
-  $profile['lastnews']);
+$spool = new BananaSpool($nntp,$group,$profile['display'], $profile['lastnews']);
 if (!$spool) error("nntpspool");
 $max = 50;
 if (isset($_REQUEST['first']) && ($_REQUEST['first']>sizeof($spool->overview)))
@@ -77,14 +76,13 @@ if (isset($_REQUEST['action']) && (isset($_REQUEST['type'])) &&
       }
       break;
     case 'new':
-      $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",stripslashes($_REQUEST['body']));
+      $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",$_REQUEST['body']);
       $message = 'From: '.$profile['name']."\n"
-        ."Newsgroups: ".stripslashes(str_replace(" ","",
-          $_REQUEST['newsgroups']))."\n"
-        ."Subject: ".stripslashes($_REQUEST['subject'])."\n"
+        ."Newsgroups: ".str_replace(" ","", $_REQUEST['newsgroups'])."\n"
+        ."Subject: ".$_REQUEST['subject']."\n"
         .(isset($profile['org'])?"Organization: ".$profile['org']."\n":"")
         .($_REQUEST['followup']!=''?'Followup-To: '
-        .stripslashes($_REQUEST['followup'])."\n":"")
+        .$_REQUEST['followup']."\n":"")
         .$news['customhdr']
         ."\n"
         .wrap($body,"",$news['wrap']);
@@ -103,13 +101,13 @@ if (isset($_REQUEST['action']) && (isset($_REQUEST['type'])) &&
                 $post->headers['references']." ":"").$post->headers['message-id'];
       }
     
-      $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",stripslashes($_REQUEST['body']));
+      $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",$_REQUEST['body']);
       $message = 'From: '.$profile['name']."\n"
-        ."Newsgroups: ".stripslashes($_REQUEST['newsgroups'])."\n"
-        ."Subject: ".stripslashes($_REQUEST['subject'])."\n"
+        ."Newsgroups: ".$_REQUEST['newsgroups']."\n"
+        ."Subject: ".$_REQUEST['subject']."\n"
         .(isset($profile['org'])?"Organization: ".$profile['org']."\n":"")
         .($_REQUEST['followup']!=''?'Followup-To: '
-        .stripslashes($_REQUEST['followup'])."\n":"")
+        .$_REQUEST['followup']."\n":"")
         ."References: $refs\n"
         .$news['customhdr']
         .$profile['customhdr']
@@ -124,8 +122,7 @@ if (isset($_REQUEST['action']) && (isset($_REQUEST['type'])) &&
       break;
   }
   $_SESSION['bananapostok']=false;
-  $spool = new BananaSpool($nntp,$group,$profile['display'],
-    $profile['lastnews']);
+  $spool = new BananaSpool($nntp,$group,$profile['display'], $profile['lastnews']);
   if (!$spool) error("nntpspool");
 }