diff --git a/edit-alias.php b/edit-alias.php
index 02ca18df..a82bc87d 100644
--- a/edit-alias.php
+++ b/edit-alias.php
@@ -62,6 +62,7 @@ if ($result['rows'] == 1)
$tGoto = $row['goto'];
$orig_alias_list = explode(',', $tGoto);
+ $tGoto = str_replace(',', "\n", $tGoto);
$alias_list = $orig_alias_list;
//. if we are not a global admin, and alias_control_admin is NO, hide the alias that's the mailbox name.
if($CONF['alias_control_admin'] == 'NO' && !authentication_has_role('global-admin')) {
@@ -101,7 +102,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$goto = preg_replace ('/\\\r\\\n/', ',', $fGoto);
$goto = preg_replace ('/\r\n/', ',', $goto);
- $goto = preg_replace ('/[\s]+/i', '', $goto);
+ $goto = preg_replace ('/,[\s]+/i', ',', $goto);
+ $goto = preg_replace ('/[\s]+,/i', ',', $goto);
$goto = preg_replace ('/,*$|^,*/', '', $goto);
$goto = preg_replace ('/,,*/', ',', $goto);
@@ -126,7 +128,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
{
$error = 1;
$tGoto = $goto;
- $tMessage = $PALANG['pEdit_alias_goto_text_error2'] . "$address";
+ if (!empty($tMessage)) $tMessage .= "
";
+ $tMessage .= $PALANG['pEdit_alias_goto_text_error2'] . "$address";
}
}
@@ -159,6 +162,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
header ("Location: list-virtual.php?domain=$fDomain");
exit;
}
+ } else { # on error
+ $tGoto = htmlentities($_POST['fGoto']);
}
}
diff --git a/templates/edit-alias.php b/templates/edit-alias.php
index 88d881ff..ed644698 100644
--- a/templates/edit-alias.php
+++ b/templates/edit-alias.php
@@ -15,12 +15,7 @@