mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
remove empty entries from the array before sending to the remote server; ensure $tMessage is defined
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1649 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
parent
547996c8c2
commit
2858fdb61e
@ -37,13 +37,14 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|||||||
$goto = preg_replace ('/[\s]+/i', '', $goto);
|
$goto = preg_replace ('/[\s]+/i', '', $goto);
|
||||||
$goto = preg_replace ('/\,*$/', '', $goto);
|
$goto = preg_replace ('/\,*$/', '', $goto);
|
||||||
$array = preg_split ('/,/', $goto);
|
$array = preg_split ('/,/', $goto);
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
// check that we have valid addresses in the list
|
// check that we have valid addresses in the list
|
||||||
foreach($array as $email_address)
|
|
||||||
|
foreach($array as $key => $email_address)
|
||||||
{
|
{
|
||||||
if (empty($email_address))
|
if (empty($email_address))
|
||||||
{
|
{
|
||||||
|
unset($array[$key]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!check_email($email_address))
|
if (!check_email($email_address))
|
||||||
@ -59,7 +60,6 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|||||||
}
|
}
|
||||||
if ($error != 1) {
|
if ($error != 1) {
|
||||||
$flag = 'forward_and_store'; // goto = $USERID_USERNAME;
|
$flag = 'forward_and_store'; // goto = $USERID_USERNAME;
|
||||||
|
|
||||||
$success = $alias->update($array, $flag);
|
$success = $alias->update($array, $flag);
|
||||||
if(!$success) {
|
if(!$success) {
|
||||||
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
|
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
|
||||||
@ -82,6 +82,10 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|||||||
}
|
}
|
||||||
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
|
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
|
||||||
textdomain('postfixadmin');
|
textdomain('postfixadmin');
|
||||||
|
|
||||||
|
if(!isset($tMessage)) {
|
||||||
|
$tMessage = '';
|
||||||
|
}
|
||||||
echo "<table bgcolor=\"$color[0]\" align=\"center\" width=\"95%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\">
|
echo "<table bgcolor=\"$color[0]\" align=\"center\" width=\"95%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\">
|
||||||
<tr>
|
<tr>
|
||||||
<td align=\"center\" bgcolor=\"$color[0]\" colspan=\"2\">
|
<td align=\"center\" bgcolor=\"$color[0]\" colspan=\"2\">
|
||||||
|
Loading…
Reference in New Issue
Block a user