🚀 HESK v3.1.2

Signed-off-by: Luke Tainton <luke@tainton.uk>
This commit is contained in:
Luke Tainton
2020-08-25 17:24:00 +01:00
parent 77512a09b4
commit 107839166a
171 changed files with 978 additions and 685 deletions

View File

@@ -289,7 +289,7 @@ function process_results($result,$tempdir)
// Convert to UTF-8 before processing further
if ($r["encoding"] != "" && $r["encoding"] != 'UTF-8')
{
$result["Data"] = $result["Data"] == "" ? "" : iconv($r["encoding"], 'UTF-8', $result["Data"]);
$result["Data"] = $result["Data"] == "" ? "" : (function_exists('iconv') ? iconv($r["encoding"], 'UTF-8', $result["Data"]) : utf8_encode($result["Data"]));
$r["encoding"] = 'UTF-8';
}

View File

@@ -2,7 +2,7 @@
/*
* mime_parser.php
*
* @(#) $Id: mime_parser.php,v 1.91 2016/08/27 22:11:07 mlemos Exp $
* @(#) $Id: mime_parser.php,v 1.93 2020/04/22 17:32:33 mlemos Exp $
*
*/
@@ -30,8 +30,8 @@ define('MIME_ADDRESS_FIRST', 2);
<package>net.manuellemos.mimeparser</package>
<version>@(#) $Id: mime_parser.php,v 1.91 2016/08/27 22:11:07 mlemos Exp $</version>
<copyright>Copyright <20> (C) Manuel Lemos 2006 - 2008</copyright>
<version>@(#) $Id: mime_parser.php,v 1.93 2020/04/22 17:32:33 mlemos Exp $</version>
<copyright>Copyright (C) Manuel Lemos 2006 - 2020</copyright>
<title>MIME parser</title>
<author>Manuel Lemos</author>
<authoraddress>mlemos-at-acm.org</authoraddress>
@@ -365,6 +365,7 @@ class mime_parser_class
var $last_carriage_return = 0;
var $header_name_characters = '!"#$%&\'()*+,-./0123456789;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}';
var $message_position = 0;
var $warn_unexpected_quoted_printable_characters = 0;
/* Private functions */
@@ -1318,17 +1319,18 @@ class mime_parser_class
continue;
}
$decoded .= substr($this->body_buffer, $position, $equal - $position);
$h = HexDec($hex=strtolower(substr($this->body_buffer, $next, 2)));
if(strcmp(sprintf('%02x', $h), $hex))
$hex=strtolower(substr($this->body_buffer, $next, 2));
if(!preg_match('/^[0-9a-f]{2}$/', $hex))
{
if(!$this->SetPositionedWarning('the body specified an invalid quoted-printable encoded character', $this->body_offset + $next))
if($this->warn_unexpected_quoted_printable_characters
&& !$this->SetPositionedWarning('the body specified an invalid quoted-printable encoded character', $this->body_offset + $next))
return(0);
$decoded.='=';
$position=$next;
}
else
{
$decoded .= Chr($h);
$decoded .= Chr(HexDec($hex));
$position = $equal + 3;
}
}
@@ -2183,7 +2185,7 @@ class mime_parser_class
$results = array();
if(!IsSet($message['Headers']['content-type:']))
$content_type = 'text/plain';
elseif(count($message['Headers']['content-type:']) == 1)
elseif(gettype($message['Headers']['content-type:']) == 'string')
$content_type = $message['Headers']['content-type:'];
else
{

View File

@@ -2,7 +2,7 @@
/*
* smtp.php
*
* @(#) $Header: /opt2/ena/metal/smtp/smtp.php,v 1.51 2016/08/23 04:55:14 mlemos Exp $
* @(#) $Header: /opt2/ena/metal/smtp/smtp.php,v 1.52 2020/01/13 06:22:23 mlemos Exp $
*
*/
@@ -12,7 +12,7 @@
<package>net.manuellemos.smtp</package>
<version>@(#) $Id: smtp.php,v 1.51 2016/08/23 04:55:14 mlemos Exp $</version>
<version>@(#) $Id: smtp.php,v 1.52 2020/01/13 06:22:23 mlemos Exp $</version>
<copyright>Copyright (C) Manuel Lemos 1999-2011</copyright>
<title>Sending e-mail messages via SMTP protocol</title>
<author>Manuel Lemos</author>
@@ -123,6 +123,24 @@ class smtp_class
*/
var $workstation="";
/*
{metadocument}
<variable>
<name>token</name>
<type>STRING</type>
<value></value>
<documentation>
<purpose>Define the authentication token when sending messages
to a SMTP server.</purpose>
<usage>Set this variable to the token value when the SMTP
server requires authentication to pass an authorization
token.</usage>
</documentation>
</variable>
{/metadocument}
*/
var $token="";
/*
{metadocument}
<variable>
@@ -280,7 +298,7 @@ class smtp_class
<variable>
<name>user_agent</name>
<type>STRING</type>
<value>SMTP Class (http://www.phpclasses.org/smtpclass $Revision: 1.51 $)</value>
<value>SMTP Class (http://www.phpclasses.org/smtpclass $Revision: 1.52 $)</value>
<documentation>
<purpose>Set the user agent used when connecting via an HTTP proxy.</purpose>
<usage>Change this value only if for some reason you want emulate a
@@ -289,7 +307,7 @@ class smtp_class
</variable>
{/metadocument}
*/
var $user_agent='SMTP Class (http://www.phpclasses.org/smtpclass $Revision: 1.51 $)';
var $user_agent='SMTP Class (http://www.phpclasses.org/smtpclass $Revision: 1.52 $)';
/*
{metadocument}
@@ -1004,6 +1022,8 @@ class smtp_class
$sasl->SetCredential("workstation",$credentials["workstation"]);
if(IsSet($credentials["mode"]))
$sasl->SetCredential("mode",$credentials["mode"]);
if(IsSet($credentials["token"]))
$sasl->SetCredential("token",$credentials["token"]);
do
{
$status=$sasl->Start($mechanisms,$message,$interactions);
@@ -1320,12 +1340,14 @@ class smtp_class
}
$credentials=array(
"user"=>$this->user,
"password"=>$this->password
"password"=>$this->password,
);
if(strlen($this->realm))
$credentials["realm"]=$this->realm;
if(strlen($this->workstation))
$credentials["workstation"]=$this->workstation;
if(strlen($this->token))
$credentials["token"]=$this->token;
$success=$this->SASLAuthenticate($mechanisms,$credentials,$authenticated,$mechanism);
if(!$success
&& !strcmp($mechanism,"PLAIN"))