From 35d08d7e90d596c07aa8f0b5c3a62cc11231df7a Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 8 Nov 2017 15:55:43 +0000 Subject: [PATCH] bugfix: do not expect query strings to start with "?" svn path=/trunk/; revision=57 --- cgilite.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cgilite.sh b/cgilite.sh index 0edb5bc..e263424 100755 --- a/cgilite.sh +++ b/cgilite.sh @@ -28,22 +28,22 @@ fi cgilite_count(){ case $1 in - GET) printf %s "${QUERY_STRING}";; - POST) printf %s "?${cgilite_post}";; - REF) printf %s "?${HTTP_REFERER#*\?}";; + GET) printf %s "&${QUERY_STRING}";; + POST) printf %s "&${cgilite_post}";; + REF) printf %s "&${HTTP_REFERER#*\?}";; esac \ - | grep -Eo '[&?]'"$2"'=[^&]*' \ + | grep -Eo '&'"$2"'=[^&]*' \ | wc -l } cgilite_value(){ printf "$( case $1 in - GET) printf %s "${QUERY_STRING}";; - POST) printf %s "?${cgilite_post}";; - REF) printf %s "?${HTTP_REFERER#*\?}";; + GET) printf %s "&${QUERY_STRING}";; + POST) printf %s "&${cgilite_post}";; + REF) printf %s "&${HTTP_REFERER#*\?}";; esac \ - | grep -Eo '[&?]'"$2"'=[^&]*' \ + | grep -Eo '&'"$2"'=[^&]*' \ | sed -rn "${3:-1}"'{s;^[^=]+=;;; s;\+; ;g; s;\\;\\\\;g; s;%;\\x;g; p}' )" } -- 2.39.2