Fix: Remove 'local' keyword from global scope in malware-scanner.sh (CRITICAL)
CRITICAL FIXES: - Line 1602: Remove 'local' from escaped_paths variable (global scope) Issue: 'local' keyword can only be used inside function definitions. Line 1602 is at global script scope (main execution body before main() function at line 2542). Using 'local' in global scope causes 'local: can only be used in a function' runtime error and script failure. RESULTS: - 1 CRITICAL issue fixed - All CRITICALs now resolved (0 remaining)
This commit is contained in:
@@ -1599,7 +1599,7 @@ STANDALONE_EOF
|
||||
|
||||
# Escape special characters for sed (handle /, \, &, |, $)
|
||||
# CRITICAL FIX: Must escape the delimiter (|) as well since we use it in the sed command
|
||||
local escaped_paths=$(printf '%s\n' "$paths_declaration" | sed -e 's/[\/&|]/\\&/g')
|
||||
escaped_paths=$(printf '%s\n' "$paths_declaration" | sed -e 's/[\/&|]/\\&/g')
|
||||
|
||||
if ! sed -i "s|PLACEHOLDER_SCAN_PATHS|$escaped_paths|" "$session_dir/scan.sh"; then
|
||||
echo -e "${RED}ERROR: Failed to generate standalone scanner script${NC}"
|
||||
|
||||
Reference in New Issue
Block a user