Skip to content

Commit 63525df

Browse files
committed
Fixes issue with pointing custom docroot to default
1 parent e894edc commit 63525df

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

web/edit/web/index.php

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -757,19 +757,23 @@
757757
unset($_POST['v-custom-doc-domain'], $_POST['v-custom-doc-folder']);
758758
}
759759

760-
if ( !empty($_POST['v-custom-doc-domain']) && !empty($_POST['v_custom_doc_root_check']) && $v_custom_doc_root_prepath.$v_custom_doc_domain.'/public_html'.$v_custom_doc_folder != $v_custom_doc_root || ($_POST['v-custom-doc-domain'] == $v_domain && !empty($_POST['v-custom-doc-folder']))){
761-
762-
$v_custom_doc_domain = escapeshellarg($_POST['v-custom-doc-domain']);
763-
$v_custom_doc_folder = escapeshellarg($_POST['v-custom-doc-folder']);
764-
765-
exec(HESTIA_CMD."v-change-web-domain-docroot ".$v_username." ".escapeshellarg($v_domain)." ".$v_custom_doc_domain." ".$v_custom_doc_folder, $output, $return_var);
766-
check_return_code($return_var,$output);
767-
unset($output);
768-
$v_custom_doc_root = 1;
769-
760+
if ( !empty($_POST['v-custom-doc-domain']) && !empty($_POST['v_custom_doc_root_check']) && $v_custom_doc_root_prepath.$v_custom_doc_domain.'/public_html'.$v_custom_doc_folder != $v_custom_doc_root){
761+
if($_POST['v-custom-doc-domain'] == $v_domain && empty($_POST['v-custom-doc-folder'])){
762+
exec(HESTIA_CMD."v-change-web-domain-docroot ".$v_username." ".escapeshellarg($v_domain)." default", $output, $return_var);
763+
check_return_code($return_var,$output);
764+
unset($output);
765+
}else{
766+
$v_custom_doc_domain = escapeshellarg($_POST['v-custom-doc-domain']);
767+
$v_custom_doc_folder = escapeshellarg($_POST['v-custom-doc-folder']);
770768

771-
}
772-
769+
exec(HESTIA_CMD."v-change-web-domain-docroot ".$v_username." ".escapeshellarg($v_domain)." ".$v_custom_doc_domain." ".$v_custom_doc_folder, $output, $return_var);
770+
check_return_code($return_var,$output);
771+
unset($output);
772+
$v_custom_doc_root = 1;
773+
}
774+
}else{
775+
unset($v_custom_doc_root);
776+
}
773777

774778
// Restart web server
775779
if (!empty($restart_web) && (empty($_SESSION['error_msg']))) {

0 commit comments

Comments
 (0)