From fc5d50e3d581456cab5f6b0e648ea6a3a5389f32 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Tue, 5 Jan 2021 12:57:07 +0100 Subject: [PATCH] modules: Array2Json fix missing + in regex --- modules/jsonDB.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/jsonDB.sh b/modules/jsonDB.sh index d80b094..62dd876 100644 --- a/modules/jsonDB.sh +++ b/modules/jsonDB.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v1.21-7-g0798f1a +#### $$VERSION$$ v1.25-dev-10-g5f50011 # # source from commands.sh to use jsonDB functions # @@ -366,7 +366,7 @@ Array2Json() { declare -n ARRAY="$1" for key in "${!ARRAY[@]}" do - [[ "${key}" =~ ^${JSSH_KEYOK}$ ]] || continue + [[ "${key}" =~ ^${JSSH_KEYOK}+$ ]] || continue # in case val contains newline convert to \n val="${ARRAY[${key}]//$'\n'/\\n}" printf '["%s"]\t"%s"\n' "${key//,/\",\"}" "${val//\"/\\\"}"