mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-26 01:07:34 +00:00
fix FILE-REGEX test
This commit is contained in:
parent
3531eb9565
commit
91ad865c17
@ -101,7 +101,7 @@ upload_file(){
|
|||||||
[[ "$file" = *'..'* ]] && return # no directory traversal
|
[[ "$file" = *'..'* ]] && return # no directory traversal
|
||||||
[[ "$file" = '.'* ]] && return # no hidden or relative files
|
[[ "$file" = '.'* ]] && return # no hidden or relative files
|
||||||
if [[ "$file" = '/'* ]] ; then
|
if [[ "$file" = '/'* ]] ; then
|
||||||
[[ ! "$file" =~ $FILE_REGEX ]] && return # absulute must match REGEX
|
[[ ! "$file" =~ "$FILE_REGEX" ]] && return # absulute must match REGEX
|
||||||
else
|
else
|
||||||
file="${UPLOADDIR:-NOUPLOADDIR}/${file}" # othiers must be in UPLOADDIR
|
file="${UPLOADDIR:-NOUPLOADDIR}/${file}" # othiers must be in UPLOADDIR
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user