]> git.plutz.net Git - clickslide/commitdiff
bugfix: allow GET/POST values starting with - (dash)
authorPaul Hänsch <paul@plutz.net>
Mon, 12 Nov 2018 01:38:08 +0000 (02:38 +0100)
committerPaul Hänsch <paul@plutz.net>
Mon, 12 Nov 2018 01:38:08 +0000 (02:38 +0100)
cgilite.sh

index e0d4b9392cda8709e80509b176961957ce0008ca..3212137e68bcb262b338256d29b29d952c3ca9d1 100755 (executable)
@@ -49,7 +49,7 @@ HEX_DECODE='
 '
 
 HEX_DECODE(){
-  printf "$(printf %s "$1" |sed -r "$HEX_DECODE")"
+  printf -- "$(printf %s "$1" |sed -r "$HEX_DECODE")"
 }
 
 if [ -z "$REQUEST_METHOD" ]; then
@@ -116,7 +116,7 @@ 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")"
 }
 
 GET(){ cgilite_value "${QUERY_STRING}" $@; }