From: Luka Perkov Date: Fri, 4 Jan 2013 10:26:08 +0000 (+0100) Subject: sanitize json_get_type function X-Git-Url: https://git.archive.openwrt.org/?p=project%2Flibubox.git;a=commitdiff_plain;h=f1735cd94e55a3547254bd7d5f3c7c8cd79dac59 sanitize json_get_type function Signed-off-by: Luka Perkov --- 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}\" ]" }