security/mailzu: Add support for php80

PR:		263614
Approved by:	submitter is maintainer
This commit is contained in:
Krzysztof 2023-11-14 18:09:14 +01:00 committed by Muhammad Moinur Rahman
parent c061bb27af
commit 070336bc55
15 changed files with 4603 additions and 10 deletions

View File

@ -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}

View File

@ -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
@ -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;
}
}

View File

@ -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 (

View File

@ -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'];

View File

@ -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'];

View File

@ -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);

View File

@ -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'];

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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
@ -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
@ -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') {
@ -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';

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,14 @@
--- lib/Template.class.php.orig 2007-06-14 19:00:15 UTC
+++ lib/Template.class.php
@@ -30,7 +30,7 @@ class Template {
* @param string $title title of page
* @param int $depth depth of the current page relative to phpScheduleIt root
*/
- function Template($title = '', $depth = 0) {
+ function __construct($title = '', $depth = 0) {
global $conf;
$this->title = (!empty($title)) ? $title : $conf['ui']['welcome'];
@@ -57,21 +57,21 @@ class Template {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

View File

@ -1,11 +1,145 @@
--- lib/htmlfilter.php.orig 2007-06-14 19:00:15 UTC
+++ lib/htmlfilter.php
@@ -106,7 +106,7 @@ function casenormalize(&$val){
@@ -106,8 +106,8 @@ function casenormalize(&$val){
function skipspace($body, $offset){
$me = 'skipspace';
preg_match('/^(\s*)/s', substr($body, $offset), $matches);
- if (sizeof($matches{1})){
+ if (is_array($matches{1}) && sizeof($matches{1})){
$count = strlen($matches{1});
- $count = strlen($matches{1});
+ if (is_array($matches[1]) && sizeof($matches[1])){
+ $count = strlen($matches[1]);
spew("$me: skipped $count chars\n");
$offset += $count;
}
@@ -159,10 +159,10 @@ function findnxreg($body, $offset, $reg){
spew("$me: No matches found.\n");
$retarr = false;
} else {
- $retarr{0} = $offset + strlen($matches{1});
- $retarr{1} = $matches{1};
- $retarr{2} = $matches{2};
- spew("$me: '$reg' found at pos $offset matching '".$matches{2}."'\n");
+ $retarr[0] = $offset + strlen($matches[1]);
+ $retarr[1] = $matches[1];
+ $retarr[2] = $matches[2];
+ spew("$me: '$reg' found at pos $offset matching '".$matches[2]."'\n");
}
return $retarr;
}
@@ -335,13 +335,13 @@ function getnxtag($body, $offset){
*/
$matches = Array();
preg_match('%^(\s*)(>|/>)%s', substr($body, $pos), $matches);
- if (isset($matches{0}) && $matches{0}){
+ if (isset($matches[0]) && $matches[0]){
/**
* Yep. So we did.
*/
spew("$me: Arrived at the end of the tag.\n");
- $pos += strlen($matches{1});
- if ($matches{2} == '/>'){
+ $pos += strlen($matches[1]);
+ if ($matches[2] == '/>'){
$tagtype = 3;
$pos++;
}
@@ -409,7 +409,7 @@ function getnxtag($body, $offset){
spew("$me: Additionally, end of tag found at $pos\n");
spew("$me: Attname is '$attname'\n");
spew("$me: Setting attvalue to 'yes'\n");
- $attary{$attname} = '"yes"';
+ $attary[$attname] = '"yes"';
return Array($tagname, $attary, $tagtype, $lt, $pos);
break;
default:
@@ -449,7 +449,7 @@ function getnxtag($body, $offset){
list($pos, $attval, $match) = $regary;
spew("$me: Attvalue is '$attval'\n");
$pos++;
- $attary{$attname} = '\'' . $attval . '\'';
+ $attary[$attname] = '\'' . $attval . '\'';
} else if ($quot == '"'){
spew("$me: In fact, this is attribute type 2\n");
spew("$me: looking for closing quote\n");
@@ -462,7 +462,7 @@ function getnxtag($body, $offset){
list($pos, $attval, $match) = $regary;
spew("$me: Attvalue is \"$attval\"\n");
$pos++;
- $attary{$attname} = '"' . $attval . '"';
+ $attary[$attname] = '"' . $attval . '"';
} else {
spew("$me: This looks like attribute type 3\n");
/**
@@ -482,7 +482,7 @@ function getnxtag($body, $offset){
spew("$me: translating '\"' into &quot;\n");
$attval = preg_replace('/\"/s', '&quot;', $attval);
spew("$me: wrapping in quotes\n");
- $attary{$attname} = '"' . $attval . '"';
+ $attary[$attname] = '"' . $attval . '"';
}
} else if (preg_match('|[\w/>]|', $char)) {
/**
@@ -490,7 +490,7 @@ function getnxtag($body, $offset){
*/
spew("$me: attribute type 4 found.\n");
spew("$me: Setting value to 'yes'\n");
- $attary{$attname} = '"yes"';
+ $attary[$attname] = '"yes"';
} else {
/**
* An illegal character. Find next '>' and return.
@@ -533,7 +533,7 @@ function deent(&$attvalue, $regex, $hex=false){
$numval = hexdec($numval);
spew("$me: hex! Numval is now $numval\n");
}
- $repl{$matches[0][$i]} = chr($numval);
+ $repl[$matches[0][$i]] = chr($numval);
}
$attvalue = strtr($attvalue, $repl);
spew("$me: attvalue after translation: $attvalue\n");
@@ -621,7 +621,7 @@ function fixatts($tagname,
if (preg_match($matchattr, $attname)){
spew("$me: Attribute '$attname' defined as bad.\n");
spew("$me: Removing.\n");
- unset($attary{$attname});
+ unset($attary[$attname]);
continue;
}
}
@@ -652,7 +652,7 @@ function fixatts($tagname,
$newvalue = preg_replace($valmatch,$valrepl,$attvalue);
if ($newvalue != $attvalue){
spew("$me: attvalue is now $newvalue\n");
- $attary{$attname} = $newvalue;
+ $attary[$attname] = $newvalue;
}
}
}
@@ -927,10 +927,10 @@ function sanitize($body,
$skip_content = false;
} else {
if ($skip_content == false){
- if (isset($open_tags{$tagname}) &&
- $open_tags{$tagname} > 0){
+ if (isset($open_tags[$tagname]) &&
+ $open_tags[$tagname] > 0){
spew("$me: popping '$tagname' from open_tags\n");
- $open_tags{$tagname}--;
+ $open_tags[$tagname]--;
} else {
spew("$me: '$tagname' was never opened\n");
spew("$me: removing\n");
@@ -972,10 +972,10 @@ function sanitize($body,
} else {
if ($tagtype == 1){
spew("$me: adding '$tagname' to open_tags\n");
- if (isset($open_tags{$tagname})){
- $open_tags{$tagname}++;
+ if (isset($open_tags[$tagname])){
+ $open_tags[$tagname]++;
} else {
- $open_tags{$tagname} = 1;
+ $open_tags[$tagname] = 1;
}
}
/**