Skip to content

Commit

Permalink
security/mailzu: Add support for php80
Browse files Browse the repository at this point in the history
PR:		263614
Approved by:	submitter is maintainer
  • Loading branch information
Krzysztof authored and 5u623l20 committed Nov 15, 2023
1 parent c061bb2 commit 070336b
Show file tree
Hide file tree
Showing 15 changed files with 4,603 additions and 10 deletions.
2 changes: 1 addition & 1 deletion security/mailzu/Makefile
@@ -1,6 +1,6 @@
PORTNAME= mailzu
DISTVERSION= 0.8rc3
PORTREVISION= 10
PORTREVISION= 11
CATEGORIES= security
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/MailZu%200.8RC3
PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX}
Expand Down
4 changes: 2 additions & 2 deletions security/mailzu/files/patch-config_langs.php
Expand Up @@ -6,7 +6,7 @@
'it' => array('it([-_][[:alpha:]]{2})?|italian', 'it.lang.php', 'it', 'Italiano'),
- 'pt_BR' => array('pt([-_]br)?|portuguese', 'pt_BR.lang.php', 'pt', 'Portuguese Brazilian')
+ 'pt_BR' => array('pt([-_]br)?|portuguese', 'pt_BR.lang.php', 'pt', 'Portuguese Brazilian'),
+ 'pl' => array('cs([-_][[:alpha:]]{2})?|polish', 'pl.lang.php', 'pl', 'Polski')
+ 'pl' => array('pl([-_][[:alpha:]]{2})?|polish', 'pl.lang.php', 'pl', 'Polski')
);

// Language files directory
Expand All @@ -19,7 +19,7 @@
for ($i = 0; $i < count($http_accepted); $i++) {
foreach ($languages as $lang => $vals) {
- if (eregi($vals[0], $http_accepted[$i]))
+ if (preg_match($vals[0], $http_accepted[$i]))
+ if (preg_match("/".$vals[0]."/", $http_accepted[$i]))
return $lang;
}
}
9 changes: 9 additions & 0 deletions security/mailzu/files/patch-lib-DBEngine.class.php
@@ -1,5 +1,14 @@
--- lib/DBEngine.class.php.orig 2007-06-14 19:00:15 UTC
+++ lib/DBEngine.class.php
@@ -67,7 +67,7 @@ class DBEngine {
* DBEngine constructor to initialize object
* @param none
*/
- function DBEngine() {
+ function __construct() {
global $conf;

$this->dbType = $conf['db']['dbType'];
@@ -133,35 +133,35 @@ class DBEngine {
MAX(stattable.pending) AS pending
FROM (
Expand Down
11 changes: 11 additions & 0 deletions security/mailzu/files/patch-lib_AmavisdEngine.class.php
@@ -0,0 +1,11 @@
--- lib/AmavisdEngine.class.php.orig 2007-06-14 19:00:15 UTC
+++ lib/AmavisdEngine.class.php
@@ -48,7 +48,7 @@ class AmavisdEngine {
* $param none
* $return object Amavisd object
*/
- function AmavisdEngine($host) {
+ function __construct($host) {

$this->socket = new Net_Socket();
$this->port = $GLOBALS['conf']['amavisd']['spam_release_port'];
11 changes: 11 additions & 0 deletions security/mailzu/files/patch-lib_DBAuth.class.php
@@ -0,0 +1,11 @@
--- lib/DBAuth.class.php.orig 2007-06-14 19:00:15 UTC
+++ lib/DBAuth.class.php
@@ -81,7 +81,7 @@ class DBAuth {
* DBEngine constructor to initialize object
* @param none
*/
- function DBAuth() {
+ function __construct() {
global $conf;

$this->dbType = $conf['auth']['dbType'];
11 changes: 11 additions & 0 deletions security/mailzu/files/patch-lib_ExchAuth.class.php
@@ -0,0 +1,11 @@
--- lib/ExchAuth.class.php.orig 2007-06-14 19:00:15 UTC
+++ lib/ExchAuth.class.php
@@ -55,7 +55,7 @@ class ExchAuth {
* @param string $domain
* @return boolean
*/
- function authUser($username, $password, $domain) {
+ function __construct($username, $password, $domain) {

$fulluser = $domain.'/'.$username;
$mbox = imap_open('{'.$this->exchHost.'/imap}Inbox', $fulluser, $password);
11 changes: 11 additions & 0 deletions security/mailzu/files/patch-lib_IMAPAuth.class.php
@@ -0,0 +1,11 @@
--- lib/IMAPAuth.class.php.orig 2007-06-14 19:00:15 UTC
+++ lib/IMAPAuth.class.php
@@ -36,7 +36,7 @@ class IMAPAuth {
* Constructor to initialize object
* @param none
*/
- function IMAPAuth() {
+ function __construct() {
global $conf;

$this->imapHosts = $conf['auth']['imap_hosts'];
9 changes: 9 additions & 0 deletions security/mailzu/files/patch-lib_LDAPEngine.class.php
@@ -1,5 +1,14 @@
--- lib/LDAPEngine.class.php.orig 2007-06-14 19:00:15 UTC
+++ lib/LDAPEngine.class.php
@@ -93,7 +93,7 @@ class LDAPEngine {
/**
* LDAPEngine constructor to initialize object
*/
- function LDAPEngine() {
+ function __construct() {
global $conf;

$this->serverType = strtolower($conf['auth']['serverType']);
@@ -283,6 +283,7 @@ class LDAPEngine {
*/
function searchUserDN($searchFilter) {
Expand Down
11 changes: 11 additions & 0 deletions security/mailzu/files/patch-lib_Link.class.php
@@ -0,0 +1,11 @@
--- lib/Link.class.php.orig 2007-06-14 19:00:15 UTC
+++ lib/Link.class.php
@@ -29,7 +29,7 @@ class Link {
* @param string $text_on_over text to display in status bar onmouseover
* @param string $on_over javascript to call onmouseover
*/
- function Link($url=null, $text=null, $class=null, $style=null, $text_on_over=null) {
+ function __construct($url=null, $text=null, $class=null, $style=null, $text_on_over=null) {
$this->url = $url;
$this->text = $text;
$this->_class = $class;
11 changes: 11 additions & 0 deletions security/mailzu/files/patch-lib_MailEngine.class.php
@@ -0,0 +1,11 @@
--- lib/MailEngine.class.php.orig 2007-06-14 19:00:15 UTC
+++ lib/MailEngine.class.php
@@ -48,7 +48,7 @@ class MailEngine {
* $param string The mail addr of the reader
* $return object MailEngine object
*/
- function MailEngine($mail_id, $recip) {
+ function __construct($mail_id, $recip) {
$this->recipient = $recip;
$this->getRawContent($mail_id);
$this->msg_error = false;
27 changes: 23 additions & 4 deletions security/mailzu/files/patch-lib_MailMime.class.php
@@ -1,6 +1,24 @@
--- lib/MailMime.class.php.orig 2007-06-14 19:00:15 UTC
+++ lib/MailMime.class.php
@@ -94,8 +94,14 @@ function MsgParseBody($struct) {
@@ -59,9 +59,15 @@ function MsgParseBody($struct) {

global $filelist;
global $errors;
- $ctype_p = strtolower(trim($struct->ctype_primary));
- $ctype_s = strtolower(trim($struct->ctype_secondary));

+ if ( is_object( $struct) ) {
+ $ctype_p = strtolower(trim($struct->ctype_primary));
+ $ctype_s = strtolower(trim($struct->ctype_secondary));
+ } else {
+ $ctype_p = $struct;
+ $ctype_s = "";
+ }
+
switch ($ctype_p) {
case "multipart":
switch ($ctype_s) {
@@ -94,8 +100,14 @@ function MsgParseBody($struct) {

case "text":
// Do not display attached text types
Expand All @@ -17,7 +35,7 @@
array_push($filelist, $attachment);
break;
}
@@ -117,7 +123,9 @@ function MsgParseBody($struct) {
@@ -117,7 +129,9 @@ function MsgParseBody($struct) {
default:
// Save the listed filename or notify the
// reader that this mail is not displayed completely
Expand All @@ -28,7 +46,7 @@
$attachment ? array_push($filelist, $attachment) : $errors['Unsupported MIME objects present'] = true;

}
@@ -137,9 +145,9 @@ function FindMultiAlt($parts) {
@@ -137,9 +151,9 @@ function FindMultiAlt($parts) {
foreach ($parts as $cur_part) {
$type = GetCtype($cur_part);
if ($type == 'multipart/related') {
Expand All @@ -41,11 +59,12 @@
}
$altCount = count($alt_pref);
for ($j = $best_view; $j < $altCount; ++$j) {
@@ -163,7 +171,7 @@ function FindMultiAlt($parts) {
@@ -163,7 +177,8 @@ function FindMultiAlt($parts) {
*/
function FindMultiRel($struct) {
$entities = array();
- $type = $struct->d_parameters['type'];
+ $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';
Expand Down

0 comments on commit 070336b

Please sign in to comment.