Skip to content

Commit f154d8c

Browse files
authored
Merge pull request hestiacp#1854 from jaapmarcus/fix/1844-public_html_custom_doc_root
hestiacp#1844 "public_html" field in "Custom document root" not load his state
2 parents ea49308 + f386e5d commit f154d8c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web/edit/web/index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,15 @@
9090
$v_custom_doc_root = realpath($data[$v_domain]['CUSTOM_DOCROOT']) . DIRECTORY_SEPARATOR;
9191

9292
if(!empty($v_custom_doc_root) &&
93-
false !== preg_match('/\/home\/'.$v_username.'\/web\/([[:alnum:]].*)\/public_html\/([[:alnum:]].*)?/', $v_custom_doc_root, $matches) ) {
93+
false !== preg_match('/\/home\/'.$v_username.'\/web\/([[:alnum:]].*?)\/public_html\/([[:alnum:]].*)?/', $v_custom_doc_root, $matches) ) {
94+
// Regex for extracting target web domain and custom document root. Regex test: https://regex101.com/r/2CLvIF/1
9495

9596
if(!empty($matches[1]))
9697
$v_custom_doc_domain = $matches[1];
9798

9899
if(!empty($matches[2]))
99100
$v_custom_doc_folder = rtrim($matches[2], '/');
100-
101+
101102
if($v_custom_doc_domain && !in_array($v_custom_doc_domain, $user_domains)) {
102103
$v_custom_doc_domain = '';
103104
$v_custom_doc_folder = '';

0 commit comments

Comments
 (0)