mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2025-02-05 11:58:24 +00:00
fix: jssjDB path must not contain more than one ..
This commit is contained in:
parent
16448a9f60
commit
f762d22958
@ -5,7 +5,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
#### $$VERSION$$ v1.2-dev2-6-geda77f8
|
||||
#### $$VERSION$$ v1.2-dev2-31-g16448a9
|
||||
#
|
||||
# source from commands.sh to use jsonDB functions
|
||||
#
|
||||
@ -204,7 +204,7 @@ jssh_checkDB_async() { jssh_checkDB "$@"; }
|
||||
jssh_checkDB(){
|
||||
local DB
|
||||
[ -z "$1" ] && return 1
|
||||
[[ "$1" = *'..'* ]] && return 2
|
||||
[[ "$1" = *'../.'* ]] && return 2
|
||||
if [[ "$1" == "${BASHBOT_VAR:-.}"* ]] || [[ "$1" == "${BASHBOT_DATA:-.}"* ]]; then
|
||||
DB="${1}.jssh"
|
||||
else
|
||||
@ -296,7 +296,7 @@ jssh_countKeyDB_async() {
|
||||
fi
|
||||
}
|
||||
|
||||
# updatie key/value in place to jsshDB
|
||||
# update key/value in place to jsshDB
|
||||
# $1 key name, can only contain -a-zA-Z0-9,._
|
||||
# $2 key value
|
||||
# $3 filename (must exist!), must be relative to BASHBOT_ETC, and not contain '..'
|
||||
|
Loading…
x
Reference in New Issue
Block a user