mirror of
https://github.com/AlbrechtL/openwrt-docker.git
synced 2026-10-15 08:01:26 +00:00
fix: Sanitize filename (#351)
This commit is contained in:
+3
-1
@@ -21,7 +21,9 @@ fi
|
||||
|
||||
BASE=$(basename "$BOOT")
|
||||
BASE="${BASE%%\?*}"
|
||||
|
||||
: "${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"
|
||||
|
||||
Reference in New Issue
Block a user