git: 8aa12b7bb4ba - main - security/maia: Update to patch upstream code for UTF-8

From: Nuno Teixeira <eduardo_at_FreeBSD.org>
Date: Thu, 01 Dec 2022 23:49:44 UTC
The branch main has been updated by eduardo:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8aa12b7bb4ba0282b310958b9897d95bc1c3e5db

commit 8aa12b7bb4ba0282b310958b9897d95bc1c3e5db
Author:     EK <ek@purplehat.org>
AuthorDate: 2022-12-01 23:44:43 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2022-12-01 23:49:08 +0000

    security/maia: Update to patch upstream code for UTF-8
    
     - This update includes a patch to fix upstream code that breaks UTF-8
       identification and/or conversion.
     - Fix WEBHOST option symlink.
    
    PR:             268087
    MFH:            2022Q4 (bug fixes)
---
 security/maia/Makefile          |  4 +++-
 security/maia/files/patch-maiad | 12 ++++++++++++
 security/maia/pkg-plist         |  2 +-
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/security/maia/Makefile b/security/maia/Makefile
index 996471ae9fe5..611c4fed77e6 100644
--- a/security/maia/Makefile
+++ b/security/maia/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	maia
 DISTVERSION=	1.0.4
-PORTREVISION=	10
+PORTREVISION=	11
 CATEGORIES=	security
 
 MAINTAINER=	ek@purplehat.org
@@ -317,7 +317,9 @@ post-patch:
 do-install:
 	${MKDIR} ${STAGEDIR}${WWWDIR} ${STAGEDIR}${WWWDIR}/web
 	@cd ${WRKSRC}/php && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR}
+.if ${PORT_OPTIONS:MWEBHOST}
 	${LN} -s ${PREFIX}/share/smarty3-${PHP_FLAVOR} ${STAGEDIR}${WWWDIR}/libs/Smarty
+.endif
 	${MKDIR} ${STAGEDIR}${DATADIR}
 	@cd ${WRKSRC}/scripts && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/scripts
 	${MKDIR} ${STAGEDIR}${ETCDIR}/templates
diff --git a/security/maia/files/patch-maiad b/security/maia/files/patch-maiad
new file mode 100644
index 000000000000..7c31a2b346e1
--- /dev/null
+++ b/security/maia/files/patch-maiad
@@ -0,0 +1,12 @@
+--- maiad.orig	2022-12-01 19:36:50 UTC
++++ maiad
+@@ -3833,9 +3833,6 @@ sub maia_store_mail($$$$$@) {
+     $subject = substr($subject, 0, 255) if length($subject) > 255;
+     $subject = untaint($subject);
+     $sender = substr($sender, 0, 255) if length($sender) > 255;
+-    if ($document_charset ne "") {
+-	from_to($contents, $document_charset, 'UTF-8');
+-    }
+ 
+     if (!$oversized) {
+         if ($dbtype =~ /^mysql$/si) { # MySQL
diff --git a/security/maia/pkg-plist b/security/maia/pkg-plist
index f82341a228c9..a349917f4709 100644
--- a/security/maia/pkg-plist
+++ b/security/maia/pkg-plist
@@ -72,7 +72,7 @@ sbin/maiad
 %%WWWDIR%%/images/view-raw.png
 %%WWWDIR%%/images/white-black-list.png
 %%WWWDIR%%/index.php
-%%WWWDIR%%/libs/Smarty
+%%WEBHOST%%%%WWWDIR%%/libs/Smarty
 %%WWWDIR%%/libs/jquery/images/arrowdown.gif
 %%WWWDIR%%/libs/jquery/images/arrowleft.gif
 %%WWWDIR%%/libs/jquery/images/arrowright.gif