Skip to content

Commit c74f442

Browse files
authored
Ensure newline at end of hestiaweb user crontab (hestiacp#4992)
1 parent fdbe95b commit c74f442

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

web/edit/server/hestiaweb/index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
exec("mktemp", $mktemp_output, $return_var);
1818
$new_conf = $mktemp_output[0];
1919
$fp = fopen($new_conf, "w");
20-
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
20+
$config = str_replace("\r\n", "\n", $_POST["v_config"]);
21+
if (!str_ends_with($config, "\n")) {
22+
$config .= "\n";
23+
}
24+
fwrite($fp, $config);
2125
fclose($fp);
2226
exec(
2327
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " hestiaweb yes",

0 commit comments

Comments
 (0)