We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bcfe1ee + 9ba1c68 commit 3c09b55Copy full SHA for 3c09b55
bin/v-change-user-language
@@ -19,9 +19,14 @@ source $VESTA/conf/vesta.conf
19
20
21
is_language_valid() {
22
- if [ ! -e "$VESTA/web/inc/i18n/$language.php" ]; then
23
- echo "Error: language $language not exist"
24
- log_event "$E_NOTEXIST $EVENT"
+ if ! [[ "$1" =~ ^[[:alnum:]_-]+$ ]]; then
+ echo "Error: language $1 is not valid"
+ log_event "$E_INVALID" "$EVENT"
25
+ exit $E_INVALID
26
+ fi
27
+ if [ ! -e "$VESTA/web/inc/i18n/$1.php" ]; then
28
+ echo "Error: language $1 doesn't exist"
29
+ log_event "$E_NOTEXIST" "$EVENT"
30
exit $E_NOTEXIST
31
fi
32
}
0 commit comments