various php bugfixes
authorx99bachelart <x99bachelart>
Fri, 5 Sep 2003 16:00:53 +0000 (16:00 +0000)
committerx99bachelart <x99bachelart>
Fri, 5 Sep 2003 16:00:53 +0000 (16:00 +0000)
article.php
include/NetNNTP.inc.php
include/post.inc.php
include/spool.inc.php
thread.php

index 76b1d1c..25ffb27 100644 (file)
@@ -67,7 +67,7 @@ $ndx = $spool->getndx($_REQUEST['id']);
 </div>
 
 <?php
-if (($_GET['type']=='cancel') && (checkcancel($post->headers))) {
+if (isset($_GET['type']) && ($_GET['type']=='cancel') && (checkcancel($post->headers))) {
 ?>
 <p class="error">
   <?php echo $locale['article']['cancel'];?>
index 08da542..915f22e 100644 (file)
@@ -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");
index 9c5ba65..a9a0c9c 100644 (file)
@@ -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;
   }
 }
index 314267d..009ec8e 100644 (file)
@@ -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;
index ca57ef6..026d8e9 100644 (file)
@@ -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'];?>
 </div>
 <?php
-echo $text;
+if (isset($text)) {
+    echo $text;
+}
 displayshortcuts();
 
 ?>