Fix others PHP Notices
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Sun, 16 Jul 2006 07:35:22 +0000 (07:35 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:35:01 +0000 (00:35 +0100)
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@112 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/NetNNTP.inc.php
banana/post.inc.php
css/banana.css

index c6d5c4e..3934cd5 100644 (file)
@@ -475,8 +475,9 @@ class nntp
             
         $array  = array();
         while (($result = $this->gline()) != '.') {
-            preg_match("/([^ \t]+) (.*)$/", $result, $regs);
-            $array[$regs[1]] = $regs[2];
+            if (preg_match("/([^ \t]+) (.*)$/", $result, $regs)) {
+                $array[$regs[1]] = $regs[2];
+            }
         }
         return $array;
     }
index b48e8b3..a7921ae 100644 (file)
@@ -209,7 +209,8 @@ class BananaPost
      */
     function _fix_charset()
     {
-        if (preg_match('!charset="?([^;"]*)"?\s*(;|$)?!', $this->headers['content-type'], $matches)) {
+        if (isset($this->headers['content-type'])
+                && preg_match('!charset="?([^;"]*)"?\s*(;|$)?!', $this->headers['content-type'], $matches)) {
             $body = iconv($matches[1], 'utf-8', $this->body);
             if (strlen($body) == 0) {
                 return false;
@@ -470,8 +471,12 @@ class BananaPost
             $res .= '</th></tr>';
         }
  
-        preg_match("@text/([^;]+);@", $this->headers['content-type'], $format);
-        $format = $format[1];
+        if (isset($this->headers['content-type'])
+                && preg_match("@text/([^;]+);@", $this->headers['content-type'], $format)) {
+            $format = $format[1];
+        } else {
+            $format = 'plain';
+        }
         $res .= '<tr class="impair"><td colspan="2" class="body"';
         if ($format == 'html') {
             if (preg_match('@<body[^>]*bgcolor="?([#0-9a-f]+)"?[^>]*>@i', $this->body, $bgcolor)) {
index bd24dfb..c432901 100644 (file)
@@ -101,7 +101,7 @@ td.conteneur_tab {
     text-align: center;
 }
 
-#onglet li:hover { background : #fc3; }
+#onglet li:hover { background : #d6e1ec; }
 
 #onglet li.actif {
     background-color: #fff;