From d0c60cf4f8431e100a0a326931388e6d11a5fd56 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 4 Apr 2019 14:07:46 +0200 Subject: [PATCH] key listing functions: GET_KEYS() POST_KEYS() REF_KEYS() --- cgilite.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cgilite.sh b/cgilite.sh index 1235077..8af3eb1 100755 --- a/cgilite.sh +++ b/cgilite.sh @@ -119,14 +119,26 @@ cgilite_value(){ 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; } +POST_KEYS(){ cgilite_keys "${cgilite_post}"; } REF(){ cgilite_value "${HTTP_REFERER#*\?}" $@; } REF_COUNT(){ cgilite_count "${HTTP_REFERER#*\?}" $1; } +REF_KEYS(){ cgilite_keys "${HTTP_REFERER#*\?}"; } COOKIE(){ HEX_DECODE "$( -- 2.39.2