Date: Sun, 19 Dec 2021 10:07:20 GMT From: Li-Wen Hsu <lwhsu@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 0cbf2ec70b86 - main - security/mailzu: Fix errors with php74 Message-ID: <202112191007.1BJA7KIY000480@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/ports/commit/?id=0cbf2ec70b866157b1e32b57e99f5f6ff3161301 commit 0cbf2ec70b866157b1e32b57e99f5f6ff3161301 Author: Krzysztof <ports@bsdserwis.com> AuthorDate: 2021-12-19 10:05:27 +0000 Commit: Li-Wen Hsu <lwhsu@FreeBSD.org> CommitDate: 2021-12-19 10:07:03 +0000 security/mailzu: Fix errors with php74 PR: 259708 --- security/mailzu/Makefile | 2 +- security/mailzu/files/patch-config_constants.php | 8 + security/mailzu/files/patch-lib-DBEngine.class.php | 24 +++ security/mailzu/files/patch-lib_CmnFns.class.php | 6 +- security/mailzu/files/patch-lib_MailMime.class.php | 52 +++++ .../files/patch-templates_quarantine.template.php | 240 ++++++++++++++++++++- .../files/patch-templates_viewmail.template.php | 15 +- 7 files changed, 340 insertions(+), 7 deletions(-) diff --git a/security/mailzu/Makefile b/security/mailzu/Makefile index f5d1b4cd6c72..6a806dc2b6c2 100644 --- a/security/mailzu/Makefile +++ b/security/mailzu/Makefile @@ -2,7 +2,7 @@ PORTNAME= mailzu DISTVERSION= 0.8rc3 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= security MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/MailZu%200.8RC3 PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX} diff --git a/security/mailzu/files/patch-config_constants.php b/security/mailzu/files/patch-config_constants.php new file mode 100644 index 000000000000..08794aec82a6 --- /dev/null +++ b/security/mailzu/files/patch-config_constants.php @@ -0,0 +1,8 @@ +--- config/constants.php.orig 2007-06-14 19:00:15 UTC ++++ config/constants.php +@@ -1,4 +1,4 @@ +-<? ++<?php + define('INTERNAL_DATE_SEPERATOR', '/'); + define('RES_TYPE_ADD', 'r'); + define('RES_TYPE_MODIFY', 'm'); diff --git a/security/mailzu/files/patch-lib-DBEngine.class.php b/security/mailzu/files/patch-lib-DBEngine.class.php index 55c4a1e9f6ea..88c09dd2ed75 100644 --- a/security/mailzu/files/patch-lib-DBEngine.class.php +++ b/security/mailzu/files/patch-lib-DBEngine.class.php @@ -141,3 +141,27 @@ FROM msgs INNER JOIN msgrcpt ON msgs.mail_id=msgrcpt.mail_id $join_type maddr AS recip ON msgrcpt.rid=recip.id WHERE msgrcpt.rs='p' AND NOT (msgs.quar_type = '') +@@ -606,7 +606,7 @@ class DBEngine { + */ + function get_raw_mail($mail_id, $email_recip) { + global $conf; +- ++ $ret_text = ""; + $mail_text_column = ' mail_text'; + # If using the bytea or BLOB type for sql quarantine use proper conversion + # (since amavisd 2.4.4 +@@ -642,12 +642,12 @@ class DBEngine { + return false; + } + while ($rs = $result->fetchRow()) { +- $return .= $rs['mail_text']; ++ $ret_text .= $rs['mail_text']; + } + + $result->free(); + +- return $return; ++ return $ret_text; + } + + /** diff --git a/security/mailzu/files/patch-lib_CmnFns.class.php b/security/mailzu/files/patch-lib_CmnFns.class.php index 2d6d19fa3c08..e78d4ebc8d61 100644 --- a/security/mailzu/files/patch-lib_CmnFns.class.php +++ b/security/mailzu/files/patch-lib_CmnFns.class.php @@ -250,7 +250,7 @@ global $conf; $fields_array = array("f" => translate('From'), -@@ -514,11 +514,11 @@ class CmnFns { +@@ -514,11 +518,11 @@ class CmnFns { ?> <table border=0 width="100%"> @@ -265,7 +265,7 @@ $i = 1; $array_size = count($fields_array); foreach ($fields_array as $k => $name) { -@@ -543,34 +543,34 @@ class CmnFns { +@@ -543,34 +547,34 @@ class CmnFns { $i ++; } ?> @@ -317,7 +317,7 @@ } -@@ -579,7 +579,7 @@ class CmnFns { +@@ -579,7 +583,7 @@ class CmnFns { * @param none * @return value boolean */ 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.... diff --git a/security/mailzu/files/patch-templates_quarantine.template.php b/security/mailzu/files/patch-templates_quarantine.template.php index 7f4c469fa24f..aa5b9b000fdb 100644 --- a/security/mailzu/files/patch-templates_quarantine.template.php +++ b/security/mailzu/files/patch-templates_quarantine.template.php @@ -1,6 +1,99 @@ --- templates/quarantine.template.php.orig 2007-06-14 19:00:15 UTC +++ templates/quarantine.template.php -@@ -143,7 +143,7 @@ function showMessagesTable($content_type +@@ -56,10 +56,10 @@ function showMessagesTable($content_type, $res, $page, + + <form name="messages_process_form" action="messagesProcessing.php" method="POST"> + +- <input type="hidden" name="ctype" value="<? echo $content_type; ?>"> +- <input type="hidden" name="query_string" value="<? echo $query_string; ?>"> ++ <input type="hidden" name="ctype" value="<?php echo $content_type; ?>"> ++ <input type="hidden" name="query_string" value="<?php echo $query_string; ?>"> + +- <? // Draw 'Release', 'Delete' and 'Delete All' buttons ++ <?php // Draw 'Release', 'Delete' and 'Delete All' buttons + printActionButtons((! CmnFns::didSearch() && ! ("Site Quarantine" == $_SESSION['sessionNav'])) ); + // Draw 'Select All, Clear All' and multi pages links + printSelectAndPager($pager_html); +@@ -74,13 +74,13 @@ function showMessagesTable($content_type, $res, $page, + <table width="100%" border="0" cellspacing="1" cellpadding="0"> + <tr> + <td colspan="5" class="tableTitle"> +- <? echo translate('Showing messages', ++ <?php echo translate('Showing messages', + array( number_format($page*$sizeLimit+1), number_format($page*$sizeLimit+$end_entry), $count )); ?> + </td> + + <td class="tableTitle"> + <div align="right"> +- <? $link->doLink('javascript: help(\'msg_index\');', '?', '', 'color: #FFFFFF;', ++ <?php $link->doLink('javascript: help(\'msg_index\');', '?', '', 'color: #FFFFFF;', + translate('Help') . ' - ' . translate('My Quarantine')) ?> + </div> + </td> +@@ -93,43 +93,43 @@ function showMessagesTable($content_type, $res, $page, + <!-- Print table's headers --> + <tr class="rowHeaders"> + <td width="3%"> </td> +- <? if ( (count($_SESSION['sessionMail']) > 1) || ((Auth::isMailAdmin()) && ++ <?php if ( (count($_SESSION['sessionMail']) > 1) || ((Auth::isMailAdmin()) && + ("Site Quarantine" == $_SESSION['sessionNav'] || "Site Pending Requests" == $_SESSION['sessionNav']))) { ?> +- <td width="15%" <? echo "recip.email"==$order?' class="reservedCell"':''; ?>> +- <? $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) ++ <td width="15%" <?php echo "recip.email"==$order?' class="reservedCell"':''; ?>> ++ <?php $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) + . '&order=recip.email&vert=' . $new_vert, translate('To'), '', '', $mouseover_text) ?> + </td> +- <? } ?> +- <td width="15%" <? echo "from_addr"==$order?' class="reservedCell"':''; ?>> +- <? $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) ++ <?php } ?> ++ <td width="15%" <?php echo "from_addr"==$order?' class="reservedCell"':''; ?>> ++ <?php $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) + . '&order=from_addr&vert=' . $new_vert, translate('From'), '', '', $mouseover_text) ?> + </td> +- <td width="40%" <? echo "msgs.subject"==$order?' class="reservedCell"':''; ?>> +- <? $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) ++ <td width="40%" <?php echo "msgs.subject"==$order?' class="reservedCell"':''; ?>> ++ <?php $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) + . '&order=msgs.subject&vert=' . $new_vert, translate('Subject'), '', '', $mouseover_text) ?> + </td> +- <td width="10%" <? echo "msgs.time_num"==$order?' class="reservedCell"':''; ?>> +- <? $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) ++ <td width="10%" <?php echo "msgs.time_num"==$order?' class="reservedCell"':''; ?>> ++ <?php $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) + . '&order=msgs.time_num&vert=' . $new_vert, translate('Date'), '', '', $mouseover_text) ?> + </td> +- <td width="7%" <? echo "spam_level"==$order?' class="reservedCell"':''; ?>> +- <? $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) ++ <td width="7%" <?php echo "spam_level"==$order?' class="reservedCell"':''; ?>> ++ <?php $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) + . '&order=spam_level&vert=' . $new_vert, translate('Score'), '', '', $mouseover_text) ?> + </td> +- <td width="10%" <? echo "msgs.content"==$order?' class="reservedCell"':''; ?>> +- <? $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) ++ <td width="10%" <?php echo "msgs.content"==$order?' class="reservedCell"':''; ?>> ++ <?php $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) + . '&order=msgs.content&vert=' . $new_vert, translate('Content Type'), '', '', $mouseover_text) ?> + </td> +- <? if ( (Auth::isMailAdmin()) && ++ <?php if ( (Auth::isMailAdmin()) && + ("Site Quarantine" == $_SESSION['sessionNav'] || "Site Pending Requests" == $_SESSION['sessionNav'])) { ?> +- <td width="10%" <? echo "mail_id"==$order?' class="reservedCell"':''; ?>> +- <? $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) ++ <td width="10%" <?php echo "mail_id"==$order?' class="reservedCell"':''; ?>> ++ <?php $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) + . '&order=mail_id&vert=' . $new_vert, translate('Mail ID'), '', '', $mouseover_text) ?> + </td> +- <? } ?> ++ <?php } ?> + </tr> + +- <? // For each line in table, print message fields ++ <?php // For each line in table, print message fields + for ($i = $start_entry; $i < $end_entry; $i++) { + $rs = $res[$i]; + // Make sure that there is a clickable subject +@@ -143,7 +143,7 @@ function showMessagesTable($content_type, $res, $page, echo "<tr class=\"$class\" align=\"center\">"; echo ' <td><input type="checkbox" onclick="ColorRow(this,\'lightyellow\')" @@ -9,3 +102,148 @@ if ( (count($_SESSION['sessionMail']) > 1) || (Auth::isMailAdmin() && ("Site Quarantine" == $_SESSION['sessionNav'] || "Site Pending Requests" == $_SESSION['sessionNav']))) { echo ' <td>' . $to . '</td>'; +@@ -192,7 +192,7 @@ function showMessagesTable($content_type, $res, $page, + </tr> + </table> + +- <? // Draw 'Select All, Clear All' and multi pages links ++ <?php // Draw 'Select All, Clear All' and multi pages links + printSelectAndPager($pager_html); + // Draw 'Release', 'Delete' and 'Delete All' buttons + printActionButtons((! CmnFns::didSearch() && ! ("Site Quarantine" == $_SESSION['sessionNav'])) ); +@@ -200,7 +200,7 @@ function showMessagesTable($content_type, $res, $page, + unset($res); ?> + + </form> +- <? } else { ++ <?php } else { + echo '<table width="100%" border="0" cellspacing="1" cellpadding="0">'; + echo '<tr><td align="center">' . translate('There are no matching records.') . '</td></tr>'; + echo '</table>'; +@@ -221,25 +221,25 @@ function printSearchEngine($content_type, $submit_page + <table width="100%" border="0" cellspacing="1" cellpadding="0"> + <tr> + <td class="tableTitle"> +- <a href="javascript: void(0);" onclick="showHideSearch('search');">› <?=translate('Search')?></a> ++ <a href="javascript: void(0);" onclick="showHideSearch('search');">› <?php echo translate('Search')?></a> + </td> + <td class="tableTitle"> + <div align="right"> +- <? $link->doLink('javascript: help(\'search\');', '?', '', 'color: #FFFFFF;', translate('Help') . ' - ' . translate('My Re ++ <?php $link->doLink('javascript: help(\'search\');', '?', '', 'color: #FFFFFF;', translate('Help') . ' - ' . translate('My Re + servations')) ?> + </div> + </td> + </tr> + </table> +-<div id="search" style="display: <?= getShowHide('search') ?>"> ++<div id="search" style="display: <?php echo getShowHide('search') ?>"> + <table width="100%" border="0" cellspacing="1" cellpadding="0"> +- <tr class="cellColor"><td><center><? CmnFns::searchEngine($content_type, $submit_page, $full_search); ?></center></td></tr> ++ <tr class="cellColor"><td><center><?php CmnFns::searchEngine($content_type, $submit_page, $full_search); ?></center></td></tr> + </table> + </div> + </td> + </tr> + </table> +-<? ++<?php + } + + +@@ -253,12 +253,12 @@ function printSelectAndPager($pager_html) { + <table class="stdFont" width="100%" border="0" cellspacing="1" cellpadding="0"> + <tr> + <td> +- <a href="javascript:CheckAll(document.messages_process_form);"><? echo translate('Select All'); ?></a> | +- <a href="javascript:CheckNone(document.messages_process_form);"><? echo translate('Clear All'); ?></a> ++ <a href="javascript:CheckAll(document.messages_process_form);"><?php echo translate('Select All'); ?></a> | ++ <a href="javascript:CheckNone(document.messages_process_form);"><?php echo translate('Clear All'); ?></a> + </td> + <td> + <div align="right"> +-<? ++<?php + // Draw the paging links if more than 1 page + echo $pager_html . "\n"; + ?> +@@ -266,7 +266,7 @@ function printSelectAndPager($pager_html) { + </td> + </tr> + </table> +-<? ++<?php + } + + /** +@@ -280,14 +280,14 @@ function printNoMesgWarning() { + <tr><td class="tableBorder"> + <table width="100%" border="0" cellspacing="1" cellpadding="0"> + <tr class="cellColor"><td> +- <center><? echo translate('No message was selected'); ?><br> +- <? $link->doLink('javascript: history.back();','‹‹ ' . translate('BackMessageIndex'), '', '', ++ <center><?php echo translate('No message was selected'); ?><br> ++ <?php $link->doLink('javascript: history.back();','‹‹ ' . translate('BackMessageIndex'), '', '', + translate('BackMessageIndex')); ?></center> + </td></tr> + </table> + </td></tr> + </table> +-<? ++<?php + } + + /** +@@ -308,7 +308,7 @@ function showFailedMessagesTable($action, $content_typ + <table width="100%" border="0" cellspacing="1" cellpadding="0"> + <tr> + <td colspan="5" class="tableTitle"> +- <? if ( $action == translate('Release') || $action == translate('Release/Request release') ) ++ <?php if ( $action == translate('Release') || $action == translate('Release/Request release') ) + echo translate('A problem occured when trying to release the following messages'); + elseif ( $action == translate('Delete') || $action == translate('Delete All') ) + echo translate('A problem occured when trying to delete the following messages'); +@@ -316,7 +316,7 @@ function showFailedMessagesTable($action, $content_typ + </td> + <td class="tableTitle"> + <div align="right"> +- <? $link->doLink('javascript: help(\'msg_index\');', '?', '', 'color: #FFFFFF;', translate('Help') ) ?> ++ <?php $link->doLink('javascript: help(\'msg_index\');', '?', '', 'color: #FFFFFF;', translate('Help') ) ?> + </div> + </td> + </tr> +@@ -325,17 +325,17 @@ function showFailedMessagesTable($action, $content_typ + <!-- Print table headers --> + <table width="100%" border="0" cellspacing="1" cellpadding="0"> + <tr class="rowHeaders"> +- <td width="20%"><? echo translate('From'); ?></td> +- <td width="30%"><? echo translate('Subject'); ?></td> +- <td width="10%"><? echo translate('Date'); ?></td> +- <? if ( 'S' == $content_type ) { ?> +- <td width="10%"><? echo translate('Score'); ?></td> +- <? } ?> +- <td width="30%"><? echo translate('Status'); ?></td> ++ <td width="20%"><?php echo translate('From'); ?></td> ++ <td width="30%"><?php echo translate('Subject'); ?></td> ++ <td width="10%"><?php echo translate('Date'); ?></td> ++ <?php if ( 'S' == $content_type ) { ?> ++ <td width="10%"><?php echo translate('Score'); ?></td> ++ <?php } ?> ++ <td width="30%"><?php echo translate('Status'); ?></td> + </tr> + + <!-- Print table rows --> +- <? ++ <?php + for ($i = 0; is_array($res) && $i < count($res); $i++) { + $rs = $res[$i]; + $subject = $rs['subject'] ? $rs['subject'] : '(none)'; +@@ -353,7 +353,7 @@ function showFailedMessagesTable($action, $content_typ + </td> + </tr> + </table> +-<? ++<?php + } + + ?> diff --git a/security/mailzu/files/patch-templates_viewmail.template.php b/security/mailzu/files/patch-templates_viewmail.template.php index 79dacdd38014..64f4c1e50b21 100644 --- a/security/mailzu/files/patch-templates_viewmail.template.php +++ b/security/mailzu/files/patch-templates_viewmail.template.php @@ -27,7 +27,18 @@ } /** -@@ -116,17 +116,17 @@ function MsgDisplayOptions($mail_id, $recip_email) { +@@ -81,7 +81,9 @@ function MsgPrintHeader($struct,$hdr_list) { + function MsgPrintHeaderFull($struct,$hdr_list) { + + foreach ($hdr_list as $hdr) { +- $header_value = $struct->headers[strtolower($hdr)]; ++ if ( isset($struct->headers[strtolower($hdr)] ) ) { ++ $header_value = $struct->headers[strtolower($hdr)]; ++ } + if (!$header_value) continue; + if (is_array($header_value)) { + $value_array = $header_value; +@@ -116,17 +118,17 @@ function MsgDisplayOptions($mail_id, $recip_email) { <table class="stdFont" width="100%"> <tr> <td align="left"> @@ -49,7 +60,7 @@ } /** -@@ -138,14 +138,14 @@ function MsgOriginalOptions() { +@@ -138,14 +140,14 @@ function MsgOriginalOptions() { <table width="100%"> <tr> <td class="stdFont" align="right">
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202112191007.1BJA7KIY000480>