Skip to content

Commit ea85928

Browse files
authored
Fix fclose() incorrect variable
fclose() is using incorrect variable $new_conf should be $fp to properly close fopen
1 parent a59ac22 commit ea85928

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

web/edit/server/dovecot/index.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
$new_conf = $mktemp_output[0];
3131
$fp = fopen($new_conf, 'w');
3232
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_config']));
33-
fclose($new_conf);
33+
fclose($fp);
3434
exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot ".$v_restart, $output, $return_var);
3535
check_return_code($return_var,$output);
3636
unset($output);
@@ -43,7 +43,7 @@
4343
$new_conf = $mktemp_output[0];
4444
$fp = fopen($new_conf, 'w');
4545
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_config1']));
46-
fclose($new_conf);
46+
fclose($fp);
4747
exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-1 " .$v_restart, $output, $return_var);
4848
check_return_code($return_var,$output);
4949
unset($output);
@@ -56,7 +56,7 @@
5656
$new_conf = $mktemp_output[0];
5757
$fp = fopen($new_conf, 'w');
5858
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_config2']));
59-
fclose($new_conf);
59+
fclose($fp);
6060
exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-2 " .$v_restart, $output, $return_var);
6161
check_return_code($return_var,$output);
6262
unset($output);
@@ -69,7 +69,7 @@
6969
$new_conf = $mktemp_output[0];
7070
$fp = fopen($new_conf, 'w');
7171
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_config3']));
72-
fclose($new_conf);
72+
fclose($fp);
7373
exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-3 " .$v_restart, $output, $return_var);
7474
check_return_code($return_var,$output);
7575
unset($output);
@@ -82,7 +82,7 @@
8282
$new_conf = $mktemp_output[0];
8383
$fp = fopen($new_conf, 'w');
8484
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_config4']));
85-
fclose($new_conf);
85+
fclose($fp);
8686
exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-4 " .$v_restart, $output, $return_var);
8787
check_return_code($return_var,$output);
8888
unset($output);
@@ -95,7 +95,7 @@
9595
$new_conf = $mktemp_output[0];
9696
$fp = fopen($new_conf, 'w');
9797
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_config5']));
98-
fclose($new_conf);
98+
fclose($fp);
9999
exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-5 " .$v_restart, $output, $return_var);
100100
check_return_code($return_var,$output);
101101
unset($output);
@@ -108,7 +108,7 @@
108108
$new_conf = $mktemp_output[0];
109109
$fp = fopen($new_conf, 'w');
110110
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_config6']));
111-
fclose($new_conf);
111+
fclose($fp);
112112
exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-6 " .$v_restart, $output, $return_var);
113113
check_return_code($return_var,$output);
114114
unset($output);
@@ -121,7 +121,7 @@
121121
$new_conf = $mktemp_output[0];
122122
$fp = fopen($new_conf, 'w');
123123
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_config7']));
124-
fclose($new_conf);
124+
fclose($fp);
125125
exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-7 " .$v_restart, $output, $return_var);
126126
check_return_code($return_var,$output);
127127
unset($output);
@@ -134,7 +134,7 @@
134134
$new_conf = $mktemp_output[0];
135135
$fp = fopen($new_conf, 'w');
136136
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_config8']));
137-
fclose($new_conf);
137+
fclose($fp);
138138
exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-8 " .$v_restart, $output, $return_var);
139139
check_return_code($return_var,$output);
140140
unset($output);

0 commit comments

Comments
 (0)