feat: Sanitize filename

This commit is contained in:
Kroese 2024-01-19 04:25:14 +01:00 committed by GitHub
parent 1ef8a9932b
commit bc6a34b366
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,8 +60,7 @@ if [ ! -f "$STORAGE/$BASE" ]; then
else else
BASE=$(basename "$VERSION") BASE=$(basename "${VERSION%%\?*}")
BASE="${BASE%%\?*}"
: "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}" : "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}"
BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g') BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g')