From: Paul Hänsch Date: Thu, 4 Apr 2019 12:09:45 +0000 (+0200) Subject: Merge branch 'master' of plutz.net:cgilite X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=e2678dc719c2dcda2de9a6079ac63837681e1a26;p=cgilite Merge branch 'master' of plutz.net:cgilite --- e2678dc719c2dcda2de9a6079ac63837681e1a26 diff --cc cgilite.sh index 8af3eb1,a84de14..7eab08a --- a/cgilite.sh +++ b/cgilite.sh @@@ -116,21 -116,11 +116,21 @@@ cgilite_value() str=${str#*&${name}=} cnt=$((cnt - 1)) done - printf "$(printf %s "${str%%&*}" |sed -r 's;\+; ;g;'"$HEX_DECODE")" + printf -- "$(printf %s "${str%%&*}" |sed -r 's;\+; ;g;'"$HEX_DECODE")" } +cgilite_keys(){ + local str="&$1" + while [ "${str#*&}" != "${str}" ]; do + str="${str#*&}" + printf '%s\n' "${str%%=*}" + done \ + | sort -u +} + GET(){ cgilite_value "${QUERY_STRING}" $@; } GET_COUNT(){ cgilite_count "${QUERY_STRING}" $1; } +GET_KEYS(){ cgilite_keys "${QUERY_STRING}"; } POST(){ cgilite_value "${cgilite_post}" $@; } POST_COUNT(){ cgilite_count "${cgilite_post}" $1; }