summaryrefslogtreecommitdiff
path: root/security/mailzu/files/patch-lib_MailMime.class.php
diff options
context:
space:
mode:
authorKrzysztof <ports@bsdserwis.com>2021-12-19 18:05:27 +0800
committerLi-Wen Hsu <lwhsu@FreeBSD.org>2021-12-19 18:07:03 +0800
commit0cbf2ec70b866157b1e32b57e99f5f6ff3161301 (patch)
tree0216a7abb952eda6fb31f95142eba970493821e7 /security/mailzu/files/patch-lib_MailMime.class.php
parentgraphics/qgis-ltr: 3.16.15 (diff)
security/mailzu: Fix errors with php74
PR: 259708
Diffstat (limited to 'security/mailzu/files/patch-lib_MailMime.class.php')
-rw-r--r--security/mailzu/files/patch-lib_MailMime.class.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/security/mailzu/files/patch-lib_MailMime.class.php b/security/mailzu/files/patch-lib_MailMime.class.php
new file mode 100644
index 000000000000..b44eb75f73fd
--- /dev/null
+++ b/security/mailzu/files/patch-lib_MailMime.class.php
@@ -0,0 +1,52 @@
+--- lib/MailMime.class.php.orig 2007-06-14 19:00:15 UTC
++++ lib/MailMime.class.php
+@@ -94,8 +94,14 @@ function MsgParseBody($struct) {
+
+ case "text":
+ // Do not display attached text types
+- if ($attachment = $struct->d_parameters['filename'] or
+- $attachment = $struct->d_parameters['name']) {
++ if ( isset($struct->d_parameters['filename']) ) {
++ $attachment = $struct->d_parameters['filename'];
++ } elseif ( isset($struct->d_parameters['name']) ) {
++ $attachment = $struct->d_parameters['name'];
++ } else {
++ $attachment = NULL;
++ }
++ if ($attachment) {
+ array_push($filelist, $attachment);
+ break;
+ }
+@@ -117,7 +123,9 @@ function MsgParseBody($struct) {
+ default:
+ // Save the listed filename or notify the
+ // reader that this mail is not displayed completely
+- $attachment = $struct->d_parameters['filename'];
++ if ( isset( $struct->d_parameters['filename'] )) {
++ $attachment = $struct->d_parameters['filename'];
++ } else { $attachment = NULL; }
+ $attachment ? array_push($filelist, $attachment) : $errors['Unsupported MIME objects present'] = true;
+
+ }
+@@ -137,9 +145,9 @@ function FindMultiAlt($parts) {
+ foreach ($parts as $cur_part) {
+ $type = GetCtype($cur_part);
+ if ($type == 'multipart/related') {
+- $type = $cur_part->d_parameters['type'];
+- // Mozilla bug. Mozilla does not provide the parameter type.
+- if (!$type) $type = 'text/html';
++ if ( isset( $cur_part->d_parameters['type'] )) { $type = $cur_part->d_parameters['type']; }
++ // Mozilla bug. Mozilla does not provide the parameter type.
++ if (!$type) $type = 'text/html';
+ }
+ $altCount = count($alt_pref);
+ for ($j = $best_view; $j < $altCount; ++$j) {
+@@ -163,7 +171,7 @@ function FindMultiAlt($parts) {
+ */
+ function FindMultiRel($struct) {
+ $entities = array();
+- $type = $struct->d_parameters['type'];
++ if ( isset( $cur_part->d_parameters['type'] )) { $type = $cur_part->d_parameters['type']; }
+ // Mozilla bug. Mozilla does not provide the parameter type.
+ if (!$type) $type = 'text/html';
+ // Bad Headers sometimes have invalid MIME....