From b991f27ba2d0ef47c5066085464560881c41d92b Mon Sep 17 00:00:00 2001 From: m8in Date: Thu, 14 May 2026 22:05:34 +0200 Subject: [PATCH] Variable assignment checking improved. --- core/base.module.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/base.module.sh b/core/base.module.sh index 0c5bdfe..5d57427 100755 --- a/core/base.module.sh +++ b/core/base.module.sh @@ -46,13 +46,9 @@ function base.checkScriptforCorrectAssignments() { while IFS= read -r _line || [[ -n "${_line}" ]]; do ((_LN++)) - [[ ! "${_line}" =~ ^.*(=\$|=\"\$).*$ ]] && continue # Assignments only - [[ "${_line}" =~ ^[[:space:]]*# ]] && continue # Comments are okay - [[ "${_line}" =~ ^[[:space:]]+[a-zA-Z0-9_]+=[^\ ]+ ]] && continue # Allow assignments in functions - - [[ "${_line}" =~ ^[a-zA-Z0-9_]+=[^\ ]+ ]] && [[ ! "${_line}" =~ "base.set" ]] \ + [[ "${_line}" =~ ^[-a-zA-Z0-9_]+=\"?\$\{?([0-9]+|@) ]] && [[ ! "${_line}" =~ "base.set" ]] \ && echo "❌ line ${_LN}: direct assignment prohibited! Use 'base.set VARNAME VALUE REGEX' instead." >&2 \ && _SUCCESS="false"