V8.00.000.2025.06.17
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -32,7 +32,7 @@ arg_check() {
|
||||
# RED
|
||||
# RES
|
||||
# ERR_UNSAFE_CHARACTER
|
||||
# LOG_ERROR
|
||||
# LOG_ERR
|
||||
# NL
|
||||
# VAR_IN_DIALOG_WR
|
||||
# Arguments:
|
||||
@@ -43,14 +43,15 @@ sanitize_arg() {
|
||||
declare disallowed_ctrl=""
|
||||
### Step 1: Check for control characters
|
||||
if printf '%s' "${input}" | grep -qP '[[:cntrl:]]'; then
|
||||
# shellcheck disable=SC2312
|
||||
disallowed_ctrl=$(printf '%s' "${input}" | sed -n 's/[^[:cntrl:]]//gp' | sed $'s/./&\\n/g' \
|
||||
| while read -r c; do printf "%02X " "'$c"; done)
|
||||
| while read -r c; do printf "%02X " "'${c}"; done)
|
||||
{
|
||||
printf "❌ Control character : '%s'. %s" "${disallowed_ctrl}" "${NL}"
|
||||
printf "❌ in argument : '%s'. %s" "${input}" "${NL}"
|
||||
printf "❌ Allowed Characters : 'a-z A-Z 0-9 . _ / = [ ] : \" - + space' %s" "${NL}"
|
||||
printf "%s" "${NL}"
|
||||
} >> "${LOG_ERROR}"
|
||||
} >> "${LOG_ERR}"
|
||||
case "${VAR_IN_DIALOG_WR}" in
|
||||
box ) dialog_box_cleaner ;;
|
||||
gauge ) dialog_gauge_cleaner ;;
|
||||
@@ -74,7 +75,7 @@ sanitize_arg() {
|
||||
printf "❌ in argument : '%s'. %s" "${input}" "${NL}"
|
||||
printf "❌ Allowed Characters : 'a-z A-Z 0-9 . _ / = [ ] : \" - + space' %s" "${NL}"
|
||||
printf "%s" "${NL}"
|
||||
} >> "${LOG_ERROR}"
|
||||
} >> "${LOG_ERR}"
|
||||
case "${VAR_IN_DIALOG_WR}" in
|
||||
box ) dialog_box_cleaner ;;
|
||||
gauge ) dialog_gauge_cleaner ;;
|
||||
|
||||
Reference in New Issue
Block a user