From: x2003bruneau Date: Sun, 16 Jul 2006 07:35:22 +0000 (+0000) Subject: Fix others PHP Notices X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=09f9870c559b7ae2cb531238ed4873cd4f6909d5;p=banana.git Fix others PHP Notices git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@112 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- diff --git a/banana/NetNNTP.inc.php b/banana/NetNNTP.inc.php index c6d5c4e..3934cd5 100644 --- a/banana/NetNNTP.inc.php +++ b/banana/NetNNTP.inc.php @@ -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; } diff --git a/banana/post.inc.php b/banana/post.inc.php index b48e8b3..a7921ae 100644 --- a/banana/post.inc.php +++ b/banana/post.inc.php @@ -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 .= ''; } - 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 .= ']*bgcolor="?([#0-9a-f]+)"?[^>]*>@i', $this->body, $bgcolor)) { diff --git a/css/banana.css b/css/banana.css index bd24dfb..c432901 100644 --- a/css/banana.css +++ b/css/banana.css @@ -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;