From f1735cd94e55a3547254bd7d5f3c7c8cd79dac59 Mon Sep 17 00:00:00 2001 From: Luka Perkov Date: Fri, 4 Jan 2013 11:26:08 +0100 Subject: [PATCH] sanitize json_get_type function Signed-off-by: Luka Perkov --- sh/jshn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sh/jshn.sh b/sh/jshn.sh index 70c3aa3..1c35711 100644 --- a/sh/jshn.sh +++ b/sh/jshn.sh @@ -197,7 +197,7 @@ json_get_type() { local cur _json_get_var cur JSON_CUR - local var="${JSON_PREFIX}TYPE_${cur}_$2" + local var="${JSON_PREFIX}TYPE_${cur}_${2//[^a-zA-Z0-9_]/_}" eval "export -- \"$dest=\${$var}\"; [ -n \"\${$var+x}\" ]" }