File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 238238
239239 }else {
240240 $ v_custom_doc_domain = escapeshellarg ($ _POST ['v-custom-doc-domain ' ]);
241+ if (substr ($ _POST ['v-custom-doc-folder ' ], -1 ) == '/ ' ){
242+ $ v_custom_doc_folder = escapeshellarg (substr ($ _POST ['v-custom-doc-folder ' ],0 ,-1 ));
243+ }else {
244+ $ v_custom_doc_folder = escapeshellarg ($ _POST ['v-custom-doc-folder ' ]);
245+ }
241246 $ v_custom_doc_folder = escapeshellarg ($ _POST ['v-custom-doc-folder ' ]);
242247 $ v_domain = escapeshellarg (trim ($ _POST ['v_domain ' ]));
243248
Original file line number Diff line number Diff line change 7676$ v_custom_doc_root_prepath = '/home/ ' .$ v_username .'/web/ ' ;
7777$ v_custom_doc_root = $ data [$ v_domain ]['CUSTOM_DOCROOT ' ];
7878
79- $ m = preg_match ('/\/home\/ ' . $ v_username . ' \/web\/([A-Za-z0-9.-] .*)\/([A-Za-z0-9.-\/ ].*)/ ' , $ v_custom_doc_root , $ matches );
79+ $ m = preg_match ('/\/home\/demo \/web\/([[:alnum:]] .*)\/public_html\/([[:alnum:] ].*)/ ' , $ v_custom_doc_root , $ matches );
8080$ v_custom_doc_domain = $ matches [1 ];
81- $ v_custom_doc_folder = str_replace ('public_html/ ' ,'' ,$ matches [2 ]);
81+ $ v_custom_doc_folder = $ matches [2 ];
82+
83+
8284
8385$ v_ftp_user = $ data [$ v_domain ]['FTP_USER ' ];
8486$ v_ftp_path = $ data [$ v_domain ]['FTP_PATH ' ];
763765 check_return_code ($ return_var ,$ output );
764766 unset($ output );
765767 }else {
768+ if (substr ($ _POST ['v-custom-doc-folder ' ], -1 ) == '/ ' ){
769+ $ v_custom_doc_folder = escapeshellarg (substr ($ _POST ['v-custom-doc-folder ' ],0 ,-1 ));
770+ }else {
771+ $ v_custom_doc_folder = escapeshellarg ($ _POST ['v-custom-doc-folder ' ]);
772+ }
766773 $ v_custom_doc_domain = escapeshellarg ($ _POST ['v-custom-doc-domain ' ]);
767- $ v_custom_doc_folder = escapeshellarg ($ _POST ['v-custom-doc-folder ' ]);
768-
774+
769775 exec (HESTIA_CMD ."v-change-web-domain-docroot " .$ v_username ." " .escapeshellarg ($ v_domain )." " .$ v_custom_doc_domain ." " .$ v_custom_doc_folder ." yes " , $ output , $ return_var );
770776 check_return_code ($ return_var ,$ output );
771777 unset($ output );
You can’t perform that action at this time.
0 commit comments