Skip to content

Commit bd24b71

Browse files
authored
Fix hestiacp#3371 HesitaCP crashes anytime Cloudflare SSL is added to Website (hestiacp#3374)
1 parent 6669c70 commit bd24b71

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

web/edit/web/index.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
if (empty($v_letsencrypt)) {
7070
$v_letsencrypt = "no";
7171
}
72-
$v_ssl_home = $data[$v_domain]["SSL_HOME"];
73-
$v_backend_template = $data[$v_domain]["BACKEND"];
72+
$v_ssl_home = $data[$v_domain]["SSL_HOME"] ?? "";
73+
$v_backend_template = $data[$v_domain]["BACKEND"] ?? "";
7474
$v_nginx_cache = $data[$v_domain]["FASTCGI_CACHE"] ?? "";
7575
$v_nginx_cache_duration = $data[$v_domain]["FASTCGI_DURATION"] ?? "";
7676
$v_nginx_cache_check = "";
@@ -848,10 +848,7 @@
848848
if (empty($_POST["v_ssl_key"])) {
849849
$errors[] = "ssl key";
850850
}
851-
if (empty($_POST["v_ssl_home"])) {
852-
$errors[] = "ssl home";
853-
}
854-
$v_ssl_home = quoteshellarg($_POST["v_ssl_home"]);
851+
855852
if (!empty($errors[0])) {
856853
foreach ($errors as $i => $error) {
857854
if ($i == 0) {
@@ -885,6 +882,7 @@
885882
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_ssl_ca"]));
886883
fclose($fp);
887884
}
885+
//keep using the original value for v_ssl_home
888886
exec(
889887
HESTIA_CMD .
890888
"v-add-web-domain-ssl " .
@@ -894,7 +892,7 @@
894892
" " .
895893
$tmpdir .
896894
" " .
897-
$v_ssl_home .
895+
quoteshellarg($v_ssl_home) .
898896
" 'no'",
899897
$output,
900898
$return_var,

0 commit comments

Comments
 (0)