v-install-wordpress: Check if MariaDB allows long database name

This commit is contained in:
myvesta 2023-02-11 19:43:58 +01:00 committed by GitHub
commit e0b90ef9d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,6 +26,7 @@ USER=$user
# Includes
source /usr/local/vesta/func/main.sh
source /usr/local/vesta/func/db.sh
source /usr/local/vesta/conf/vesta.conf
if [ -z "$user" ]; then
check_result $E_NOTEXIST "domain $domain doesn't exist"
@ -49,7 +50,11 @@ is_object_unsuspended 'user' 'USER' "$user"
source /usr/local/vesta/func/handle_parameters.sh
if [ -z "$database" ]; then
database=$(echo "$domain" | sed 's#\.#_#g')
if [ ! -z "$MAX_DBUSER_LEN" ] && [ "$MAX_DBUSER_LEN" -ge 80 ]; then
database=$(echo "$domain" | sed 's#\.#_#g')
else
database="wp"
fi
fi
if [ -z "$email" ]; then