fix: Sanitize filename (#352)
This commit is contained in:
parent
911a775a90
commit
c49ac1569f
1 changed files with 3 additions and 2 deletions
|
@ -20,10 +20,11 @@ if [ -z "$BOOT" ]; then
|
|||
fi
|
||||
|
||||
BASE=$(basename "$BOOT")
|
||||
BASE="${BASE%%\?*}"
|
||||
[ -f "$STORAGE/$BASE" ] && return 0
|
||||
|
||||
BASE=$(basename "${BOOT%%\?*}")
|
||||
: "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}"
|
||||
BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g')
|
||||
|
||||
[ -f "$STORAGE/$BASE" ] && return 0
|
||||
|
||||
TMP="$STORAGE/${BASE%.*}.tmp"
|
||||
|
|
Loading…
Reference in a new issue