From 33683e10efeff5c77736d18d6391816ae901f849 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Sun, 16 Jul 2006 07:35:22 +0000 Subject: [PATCH] Fix others PHP Notices git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@112 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- banana/NetNNTP.inc.php | 5 +++-- banana/post.inc.php | 11 ++++++++--- css/banana.css | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) 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; -- 2.1.4