diff --git a/lib/lib_sanitizer.sh b/lib/lib_sanitizer.sh index e07a127..968843e 100644 --- a/lib/lib_sanitizer.sh +++ b/lib/lib_sanitizer.sh @@ -35,11 +35,10 @@ arg_check() { sanitize_arg() { declare input="$1" # Define allowed characters: - # letters, digits, dot, underscore, slash, equals, [, ], colon, double-quote, hyphen, plus, space. - declare allowed + # letters, digits, dot, underscore, slash, equals, [, ], colon, double-quote, hyphen, space. + declare allowed='a-zA-Z0-9._/=\[\]:"\-+ ' declare disallowed - allowed='a-zA-Z0-9._/=[]:"-+ ' - disallowed=$(printf '%s' "$input" | sed "s/[$allowed]//g") + disallowed=$(printf '%s' "${input}" | tr -d "${allowed}") if [[ -n ${disallowed} ]]; then {