File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,16 +186,18 @@ if [[ "${INSTALL_WORDPRESS}" == "1" ]]; then
186186 if (( ${# domain_parts[@]} >= 3 )) ; then
187187 public_suffix=" ${domain_parts[${#domain_parts[@]} -2]}.${domain_parts[${#domain_parts[@]} -1]}"
188188 case " ${public_suffix} " in
189- co.uk|org.uk|gov.uk|ac.uk|com.au|net.au|org.au|co.nz|org.nz|com.br)
189+ co.uk|org.uk|gov.uk|ac.uk|com.au|net.au|org.au|co.nz|org.nz|com.br|com.sg|com.my|com.mx|co.za|com.tr|com.hk )
190190 domain_without_tld=" ${domain_parts[${#domain_parts[@]} -3]}"
191191 ;;
192192 esac
193193 fi
194194 # RAND_CHAR4, RAND_CHAR16, and RAND_CHAR32 are random strings (length 4/16/32)
195195 # sourced from /usr/local/bin/enginescript/enginescript-variables.txt.
196196 database_name=" ${domain_without_tld} _${RAND_CHAR4} "
197+ # Normalize to lowercase for MySQL/MariaDB portability across platforms
198+ database_name=" ${database_name,,} "
197199 # Validate DB identifier before writing credentials file or interpolating into SQL
198- if [[ -z " ${database_name} " || ! " ${database_name} " =~ ^[A-Za- z_][A-Za -z0-9_]* $ ]]; then
200+ if [[ -z " ${database_name} " || ! " ${database_name} " =~ ^[a- z_][a -z0-9_]* $ ]]; then
199201 echo " Error: Invalid database name '${database_name} ' for domain '${DOMAIN} '." >&2
200202 exit 1
201203 fi
You can’t perform that action at this time.
0 commit comments