fix FILE-REGEX test

This commit is contained in:
Kay Marquardt 2019-11-27 08:58:45 +01:00 committed by GitHub
parent 3531eb9565
commit 91ad865c17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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