Allow spaces when using a parameter such as --auditor

This commit is contained in:
Michael Boelen 2025-07-30 22:17:54 +00:00
parent 4d55f7a0c9
commit 76a4f4dfd8
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04

View File

@ -3070,8 +3070,11 @@
# Test against the string with a generic test set
if [ $# -eq 1 ]; then
input="$1"
# Only allow common set of characters: a-z, A-Z, 0-9, /._-:=
cleaned=$(echo "$input" | sed 's/[^a-zA-Z0-9\/\._:=-]//g')
# Use sed to strip all characters -except- those that are allowed
# - Common set of characters: a-z, A-Z, 0-9
# - Special characters: , /._-:=
# - Space for names (like auditor name)
cleaned=$(echo "$input" | sed 's/[^[:space:]a-zA-Z0-9\/\._:=-]//g')
# If two parameters are specified, then test input against specified class
elif [ $# -eq 2 ]; then
input="$1"