From 75ff2f64dbf23a7d05f2f42a9577d731107c2839 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Sun, 2 Jan 2005 21:01:08 +0000 Subject: [PATCH] wibble bug with spool refresh though :( --- include/spool.inc.php | 15 ++++++++++----- thread.php | 23 ++++++++++------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/include/spool.inc.php b/include/spool.inc.php index 72d8a62..8fba366 100644 --- a/include/spool.inc.php +++ b/include/spool.inc.php @@ -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 = 'o'; $spfx_n = '*'; @@ -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) { diff --git a/thread.php b/thread.php index 8eeee78..4f9e53b 100644 --- a/thread.php +++ b/thread.php @@ -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"); } -- 2.1.4