diff --git a/lib/user-manager.sh b/lib/user-manager.sh index 7770566..45b11b4 100755 --- a/lib/user-manager.sh +++ b/lib/user-manager.sh @@ -230,6 +230,7 @@ get_system_user_info() { ############################################################################# get_user_domains() { + [ -z "$1" ] && return 1 local username="$1" case "$SYS_CONTROL_PANEL" in @@ -249,6 +250,7 @@ get_user_domains() { } get_cpanel_user_domains() { + [ -z "$1" ] && return 1 local username="$1" # Primary domain (format: domain: user) diff --git a/modules/backup/acronis-troubleshoot.sh b/modules/backup/acronis-troubleshoot.sh index 2efc12a..339a2ad 100755 --- a/modules/backup/acronis-troubleshoot.sh +++ b/modules/backup/acronis-troubleshoot.sh @@ -56,16 +56,19 @@ declare -a RECOMMENDATIONS=() # Function to add issue add_issue() { + [ -z "$1" ] && return 1 ISSUES_FOUND+=("$1") } # Function to add warning add_warning() { + [ -z "$1" ] && return 1 WARNINGS_FOUND+=("$1") } # Function to add recommendation add_recommendation() { + [ -z "$1" ] && return 1 RECOMMENDATIONS+=("$1") } diff --git a/tools/toolkit-qa-check.sh b/tools/toolkit-qa-check.sh index d1d3202..9b4651f 100755 --- a/tools/toolkit-qa-check.sh +++ b/tools/toolkit-qa-check.sh @@ -472,8 +472,15 @@ while read -r file; do func_name=$(echo "$func_line" | sed 's/^\s*//; s/(.*$//') # Check if function uses parameters (exclude AWK/sed field references) - # Get function body and filter out awk/sed commands before checking for $1-9 - func_body=$(grep -A 20 "^[[:space:]]*$func_name()" "$file" 2>/dev/null | grep -v 'awk\|sed' || true) + # Get function body - need to handle multi-line AWK/sed blocks + func_body=$(grep -A 20 "^[[:space:]]*$func_name()" "$file" 2>/dev/null) + + # Remove AWK blocks completely (from awk ' to closing ') + # This handles multi-line AWK scripts where $1 is AWK field reference + func_body_clean=$(echo "$func_body" | sed '/awk.*'"'"'/,/'"'"'/d' | grep -v 'sed ') + + # Use cleaned body for detection + func_body="$func_body_clean" # Skip functions that only use $@ or $* (passthrough/wrapper functions) if echo "$func_body" | grep -E '^\s*(echo|printf).*\$[@*]' | grep -qv '\$[1-9]'; then