remove non UTF-8 characters on get and send strings

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2019-12-07 13:03:27 +01:00
parent e3ba1a053c
commit f9c107850a

View File

@ -101,7 +101,7 @@ upload_file(){
[[ "$file" = *'..'* ]] && return # no directory traversal
[[ "$file" = '.'* ]] && return # no hidden or relative files
if [[ "$file" = '/'* ]] ; then
[[ ! "$file" =~ "$FILE_REGEX" ]] && return # absulute must match REGEX
[[ ! "$file" =~ $FILE_REGEX ]] && return # absulute must match REGEX
else
file="${UPLOADDIR:-NOUPLOADDIR}/${file}" # othiers must be in UPLOADDIR
fi