From 75c9bae48f63368dee9cf43b25f2fce59d44ae28 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Sat, 15 Jul 2006 14:17:53 +0000 Subject: [PATCH] Fix some PHP Notices git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@108 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- banana/post.inc.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/banana/post.inc.php b/banana/post.inc.php index bc7f37e..9f3dc59 100644 --- a/banana/post.inc.php +++ b/banana/post.inc.php @@ -58,7 +58,7 @@ class BananaPost if ($this->_split_multipart($this->headers, $this->body)) { $this->set_body_to_part(0); - } else { + } elseif(isset($mpart_type)) { $this->_split_multipart($mpart_type[1], $mpart_boundary[1]); $this->_find_uuencode(); $this->_fix_charset(); @@ -90,7 +90,8 @@ class BananaPost */ function _split_multipart($headers, $body) { - if (!preg_match("@multipart/([^;]+);@", $headers['content-type'], $type)) { + if (!isset($headers['content-type']) + || !preg_match("@multipart/([^;]+);@", $headers['content-type'], $type)) { return false; } @@ -138,6 +139,7 @@ class BananaPost { global $banana; + $local_headers = Array(); $lines = split("\n", $part); while (count($lines)) { $line = array_shift($lines); @@ -156,7 +158,8 @@ class BananaPost } } $local_body = join("\n", $lines); - if (preg_match("/quoted-printable/", $local_headers['content-transfer-encoding'])) { + if (isset($local_headers['content-transfer-encoding']) + && preg_match("/quoted-printable/", $local_headers['content-transfer-encoding'])) { $local_body = quoted_printable_decode($local_body); } return Array('headers' => $local_headers, 'body' => $local_body); @@ -174,7 +177,7 @@ class BananaPost $filename = $filename[1]; } if (!isset($filename)) { - $filename = "attachment".count($pj); + $filename = "attachment" . count($this->pj); } if (isset($local_header['content-type']) @@ -427,6 +430,7 @@ class BananaPost . '' . ''; + $xface = null; foreach ($banana->show_hdr as $hdr) { if (isset($this->headers[$hdr])) { $res2 = formatdisplayheader($hdr, $this->headers[$hdr]); -- 2.1.4