From: paul Date: Thu, 22 Mar 2018 15:41:39 +0000 (+0000) Subject: documentation fo STORE function X-Git-Url: http://git.plutz.net/?p=cgilite;a=commitdiff_plain;h=147a3ae4c390dfc186f25b0aba267d7ff23b2151 documentation fo STORE function svn path=/trunk/; revision=64 --- diff --git a/files.sh b/files.sh index 6c459c5..bf8b7b9 100755 --- a/files.sh +++ b/files.sh @@ -27,8 +27,14 @@ STORE(){ # Store fields from a HTTP GET or POST string in a file # usage: STORE "${QUERY_STRING}" # or: STORE "$(head -n $HTTP_CONTENT_LENGTH)" + # backslashes and newline characters will be escaped in field values, + # the escape symbol is a backslash + # hexadecimal character descriptions (%00 - %FF) will be expanded + # the + character will be converted to [space] + # one line in the output corresponds to exactly one field, so you can + # use grep to filter which fields of a query should be stored printf "$( - printf '&%s' "$@" \ + printf '%s' "$@" \ | sed -r ':X; $bY; N; bX; :Y; s;\+; ;g; s;(\\|5[Cc]);\\\\\\\\;g; s;(\n|%0[Aa]);\\\\n;g; s;(^|&)([^=]+)=;\1\2:;g; s;&;\n;g; s;^\n+;;; s;$;\\n;; s;\n+;\n;g;