Janketh Jay wrote on 2018/12/30 01:03:
[...]
diff -Naur maia.orig/cache.php maia/cache.php
--- maia.orig/cache.php 2015-02-15 15:19:45.000000000 -0700
+++ maia/cache.php 2018-10-14 20:25:30.278960000 -0600
@@ -554,7 +554,7 @@
$rectmp = "";
foreach ($to_list as $recipient) {
if (isset($personal_addresses[$recipient]) ||
$domain_default) {
- $rectmp[] = $recipient;
+ $rectmp = $recipient;
}
}
$rows[$count]['recipient_email'] = $rectmp;
Essentially, you just need to remove the "[]" from "rectmp" on
line 558 in your /usr/local/www/maia/cache.php file.
I don't use Maia Mailguard and I didn't read the source code but I think
your patch is wrong. It changed the function. Original code assigned all
recipient addresses (appending) in to an array (hash) $rectmp in a
foreach loop and then assign this array to $rows[$count]['recipient_email'].
But now you are using it as variable so if there are more than one
recipient this variable is overwritten on each iteration and then just
the last recipient is assigned to $rows[$count]['recipient_email'].
My very wild guess is that it should be like this
- $rectmp = "";
+ $rectmp = array();
foreach ($to_list as $recipient) {
if (isset($personal_addresses[$recipient]) ||
$domain_default) {
$rectmp[] = $recipient;
}
}
$rows[$count]['recipient_email'] = $rectmp;
I guess you want to fix some PHP 7 warning / syntax error with $rectmp
created ass plain variable and later used as an array so I defined as an
array first.
But maybe I am totally wrong :)
I just made similar fix few days ago in an old version of PostfixAdmin
after upgrade from PHP 5.6 to 7.1.
Miroslav Lachman
_______________________________________________
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"