Skip to content

Commit 868f905

Browse files
committed
improved database validation
1 parent 5268ffb commit 868f905

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

func/main.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,9 +590,9 @@ validate_format_domain_alias() {
590590

591591
# Database
592592
validate_format_database() {
593-
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|.|<|>|?|/|\|\"|'|;|%|\`| ]"
593+
exclude="[!|@|#|$|^|&|*|(|)|+|-|=|{|}|:|,|.|<|>|?|/|\|\"|'|;|%|\`| ]"
594594
if [[ "$1" =~ $exclude ]] || [ 17 -le ${#1} ]; then
595-
echo "Error: database $1 is not valid"
595+
echo "Error: $2 $1 is not valid"
596596
log_event "$E_INVALID" "$EVENT"
597597
exit $E_INVALID
598598
fi
@@ -717,10 +717,10 @@ validate_format(){
717717
backup) validate_format_date "$arg" ;;
718718
charset) validate_format_username "$arg" "$arg_name" ;;
719719
charsets) validate_format_common "$arg" 'charsets' ;;
720-
database) validate_format_database "$arg" ;;
720+
database) validate_format_database "$arg" 'database';;
721721
day) validate_format_mhdmw "$arg" $arg_name ;;
722722
dbpass) validate_format_password "$arg" ;;
723-
dbuser) validate_format_database "$arg" ;;
723+
dbuser) validate_format_database "$arg" 'db_user';;
724724
dkim) validate_format_boolean "$arg" 'dkim' ;;
725725
dkim_size) validate_format_key_size "$arg" ;;
726726
domain) validate_format_domain "$arg" ;;

0 commit comments

Comments
 (0)