Skip to content

Commit de9da7e

Browse files
committed
fixed mail alias/fwd editing
1 parent 7ab90ac commit de9da7e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

web/edit/mail/index.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@
251251
$v_aliases = str_replace(' ', "\n", $waliases);
252252
$result = array_diff($valiases, $aliases);
253253
foreach ($result as $alias) {
254-
if (empty($_SESSION['error_msg'])) {
255-
exec (VESTA_CMD."v_delete_mail_account_alias ".$v_username." ".$v_domain." ".$v_account." '".$alias, $output, $return_var);
254+
if ((empty($_SESSION['error_msg'])) && (!empty($alias))) {
255+
exec (VESTA_CMD."v_delete_mail_account_alias ".$v_username." ".$v_domain." ".$v_account." '".$alias."'", $output, $return_var);
256256
if ($return_var != 0) {
257257
$error = implode('<br>', $output);
258258
if (empty($error)) $error = 'Error: vesta did not return any output.';
@@ -263,8 +263,8 @@
263263
}
264264
$result = array_diff($aliases, $valiases);
265265
foreach ($result as $alias) {
266-
if (empty($_SESSION['error_msg'])) {
267-
exec (VESTA_CMD."v_add_mail_account_alias ".$v_username." ".$v_domain." ".$v_account." '".$alias, $output, $return_var);
266+
if ((empty($_SESSION['error_msg'])) && (!empty($alias))) {
267+
exec (VESTA_CMD."v_add_mail_account_alias ".$v_username." ".$v_domain." ".$v_account." '".$alias."'", $output, $return_var);
268268
if ($return_var != 0) {
269269
$error = implode('<br>', $output);
270270
if (empty($error)) $error = 'Error: vesta did not return any output.';
@@ -285,7 +285,7 @@
285285
$v_fwd = str_replace(' ', "\n", $wfwd);
286286
$result = array_diff($vfwd, $fwd);
287287
foreach ($result as $forward) {
288-
if (empty($_SESSION['error_msg'])) {
288+
if ((empty($_SESSION['error_msg'])) && (!empty($forward))) {
289289
exec (VESTA_CMD."v_delete_mail_account_forward ".$v_username." ".$v_domain." ".$v_account." '".$forward."'", $output, $return_var);
290290
if ($return_var != 0) {
291291
$error = implode('<br>', $output);
@@ -297,7 +297,7 @@
297297
}
298298
$result = array_diff($fwd, $vfwd);
299299
foreach ($result as $forward) {
300-
if (empty($_SESSION['error_msg'])) {
300+
if ((empty($_SESSION['error_msg'])) && (!empty($forward))) {
301301
exec (VESTA_CMD."v_add_mail_account_forward ".$v_username." ".$v_domain." ".$v_account." '".$forward."'", $output, $return_var);
302302
if ($return_var != 0) {
303303
$error = implode('<br>', $output);

0 commit comments

Comments
 (0)