Kaynağa Gözat

Fix #3371 HesitaCP crashes anytime Cloudflare SSL is added to Website (#3374)

Jaap Marcus 3 yıl önce
ebeveyn
işleme
bd24b71111
1 değiştirilmiş dosya ile 5 ekleme ve 7 silme
  1. 5 7
      web/edit/web/index.php

+ 5 - 7
web/edit/web/index.php

@@ -69,8 +69,8 @@ $v_letsencrypt = $data[$v_domain]["LETSENCRYPT"];
 if (empty($v_letsencrypt)) {
 	$v_letsencrypt = "no";
 }
-$v_ssl_home = $data[$v_domain]["SSL_HOME"];
-$v_backend_template = $data[$v_domain]["BACKEND"];
+$v_ssl_home = $data[$v_domain]["SSL_HOME"] ?? "";
+$v_backend_template = $data[$v_domain]["BACKEND"] ?? "";
 $v_nginx_cache = $data[$v_domain]["FASTCGI_CACHE"] ?? "";
 $v_nginx_cache_duration = $data[$v_domain]["FASTCGI_DURATION"] ?? "";
 $v_nginx_cache_check = "";
@@ -848,10 +848,7 @@ if (!empty($_POST["save"])) {
 		if (empty($_POST["v_ssl_key"])) {
 			$errors[] = "ssl key";
 		}
-		if (empty($_POST["v_ssl_home"])) {
-			$errors[] = "ssl home";
-		}
-		$v_ssl_home = quoteshellarg($_POST["v_ssl_home"]);
+
 		if (!empty($errors[0])) {
 			foreach ($errors as $i => $error) {
 				if ($i == 0) {
@@ -885,6 +882,7 @@ if (!empty($_POST["save"])) {
 				fwrite($fp, str_replace("\r\n", "\n", $_POST["v_ssl_ca"]));
 				fclose($fp);
 			}
+			//keep using the original value for v_ssl_home
 			exec(
 				HESTIA_CMD .
 					"v-add-web-domain-ssl " .
@@ -894,7 +892,7 @@ if (!empty($_POST["save"])) {
 					" " .
 					$tmpdir .
 					" " .
-					$v_ssl_home .
+					quoteshellarg($v_ssl_home) .
 					" 'no'",
 				$output,
 				$return_var,