Skip to content

Commit 3e61c7e

Browse files
LupulScIT-Raphael
authored andcommitted
Remove trailing slash from target-domain-dir that caused CUSTOM_DOCROOT to contain double slash in some cases
1 parent 56154eb commit 3e61c7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/v-change-web-domain-docroot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ if [ "$target_domain" = "default" ]; then
8080
update_object_value 'web' 'DOMAIN' "$domain" '$CUSTOM_PHPROOT' ""
8181
else
8282
# Check for existence of specified directory under target domain's public_html folder
83-
target_domain_directory="$HOMEDIR/$user/web/$target_domain/"
83+
target_domain_directory="$HOMEDIR/$user/web/$target_domain"
8484
if [ ! -z "$target_directory" ]; then
8585

8686
# Checking destination path
8787
real_target_directory="$(readlink -e "${target_domain_directory}/public_html/$target_directory/")"
88-
if [ -z "$(echo $real_target_directory | egrep "^$target_domain_directory")" ]; then
88+
if [ -z "$(echo $real_target_directory | egrep "^$target_domain_directory\b")" ]; then
8989
check_result $E_FORBIDEN "Error: target dir outside of target domain dir"
9090
fi
9191

0 commit comments

Comments
 (0)