From 5c33c60879914edc0e6c971e96073a44608a1521 Mon Sep 17 00:00:00 2001 From: x99bachelart Date: Fri, 5 Sep 2003 16:00:53 +0000 Subject: [PATCH] various php bugfixes --- article.php | 2 +- include/NetNNTP.inc.php | 1 + include/post.inc.php | 2 +- include/spool.inc.php | 8 ++++++-- thread.php | 11 ++++++++--- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/article.php b/article.php index 76b1d1c..25ffb27 100644 --- a/article.php +++ b/article.php @@ -67,7 +67,7 @@ $ndx = $spool->getndx($_REQUEST['id']); headers))) { +if (isset($_GET['type']) && ($_GET['type']=='cancel') && (checkcancel($post->headers))) { ?>

diff --git a/include/NetNNTP.inc.php b/include/NetNNTP.inc.php index 08da542..915f22e 100644 --- a/include/NetNNTP.inc.php +++ b/include/NetNNTP.inc.php @@ -361,6 +361,7 @@ class nntp { function newnews($_since,$_groups="*",$_distributions="") { $distributions = preg_replace("/(\r|\n)/","",$_distributions); $groups = preg_replace("/(\r|\n)/","",$_groups); + $array=array(); #assume $since is a unix timestamp $this->pline("NEWNEWS $_groups ".gmdate("ymd His",$_since) ." GMT $distributions\r\n"); diff --git a/include/post.inc.php b/include/post.inc.php index 9c5ba65..a9a0c9c 100644 --- a/include/post.inc.php +++ b/include/post.inc.php @@ -115,7 +115,7 @@ class Headers { $this->name = trim($match[3]); $this->mail = $match[1]."@".$match[2]; } - $this->nb=$id; + $this->nb=$_id; $retour->numerr=0; } } diff --git a/include/spool.inc.php b/include/spool.inc.php index 314267d..009ec8e 100644 --- a/include/spool.inc.php +++ b/include/spool.inc.php @@ -107,7 +107,7 @@ class spool { "$first-$last")); $refs = $_nntp->xhdr("References","$first-$last"); # $this->date=$nntp->date; - if ($this->ids) { + if (isset($this->ids)) { $this->ids=array_merge($this->ids,array_flip($msgids)); } else { $this->ids=array_flip($msgids); @@ -124,7 +124,11 @@ class spool { $p = $msg->parent; while ($p) { $this->overview[$p]->desc++; - $p = $this->overview[$p]->parent; + if (isset($this->overview[$p]->parent)) { + $p = $this->overview[$p]->parent; + } else { + $p = false; + } } if ($msg->parent!="") $this->overview[$msg->parent]->children[]=$id; diff --git a/thread.php b/thread.php index ca57ef6..026d8e9 100644 --- a/thread.php +++ b/thread.php @@ -28,7 +28,10 @@ if (isset($_REQUEST['group'])) { } else { $group=htmlentities(strtolower(strtok(str_replace(" ","",$_REQUEST['newsgroups']),","))); } -$id=htmlentities(strtolower($_REQUEST['id'])); + +if (isset($_REQUEST['id'])) { + $id=htmlentities(strtolower($_REQUEST['id'])); +} //$mynntp = new nntp($news['server'],120,1); $mynntp = new nntp($news['server']); @@ -55,7 +58,7 @@ if (!$spool) { exit; } $max = 50; -if ($_REQUEST['first']>sizeof($spool->overview)) +if (isset($_REQUEST['first']) && ($_REQUEST['first']>sizeof($spool->overview))) $_REQUEST['first']=sizeof($spool->overview); $first = (isset($_REQUEST['first'])? (floor($_REQUEST['first']/$max)*$max+1):1); @@ -148,7 +151,9 @@ if (isset($_REQUEST['action']) && (isset($_REQUEST['type']))) { .$locale['thread']['group_a'];?> -- 2.1.4