mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
commit
3c09b5526f
1 changed files with 8 additions and 3 deletions
|
@ -19,9 +19,14 @@ source $VESTA/conf/vesta.conf
|
|||
|
||||
|
||||
is_language_valid() {
|
||||
if [ ! -e "$VESTA/web/inc/i18n/$language.php" ]; then
|
||||
echo "Error: language $language not exist"
|
||||
log_event "$E_NOTEXIST $EVENT"
|
||||
if ! [[ "$1" =~ ^[[:alnum:]_-]+$ ]]; then
|
||||
echo "Error: language $1 is not valid"
|
||||
log_event "$E_INVALID" "$EVENT"
|
||||
exit $E_INVALID
|
||||
fi
|
||||
if [ ! -e "$VESTA/web/inc/i18n/$1.php" ]; then
|
||||
echo "Error: language $1 doesn't exist"
|
||||
log_event "$E_NOTEXIST" "$EVENT"
|
||||
exit $E_NOTEXIST
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue