summaryrefslogtreecommitdiff
path: root/frontends/cgi
diff options
context:
space:
mode:
authorRichard Nelson <unixabg@gmail.com>2013-03-25 16:43:18 -0500
committerDaniel Baumann <mail@daniel-baumann.ch>2013-05-06 14:50:07 +0200
commit153a796b31385f118c51d7722f64c2bbf443cd5a (patch)
tree6759028068dc1f4d31864180810897cdd16c6a65 /frontends/cgi
parentff6a7fd628a0f970881ba5c620ba4270957baf7d (diff)
downloadvyos-live-build-153a796b31385f118c51d7722f64c2bbf443cd5a.tar.gz
vyos-live-build-153a796b31385f118c51d7722f64c2bbf443cd5a.zip
Converting l-b-cgi frontend to process forms with post.
Diffstat (limited to 'frontends/cgi')
-rwxr-xr-xfrontends/cgi/live-build-cgi13
1 files changed, 8 insertions, 5 deletions
diff --git a/frontends/cgi/live-build-cgi b/frontends/cgi/live-build-cgi
index 454c8abb2..5a65bce89 100755
--- a/frontends/cgi/live-build-cgi
+++ b/frontends/cgi/live-build-cgi
@@ -32,6 +32,14 @@ fi
echo "Content-type: text/html"
echo
+#QUERY_STRING=`cat /dev/stdin`
+QUERY_STRING=$(cat /dev/stdin)
+# Translate parameters
+QUERY_STRING=$(echo "${QUERY_STRING}" | sed -e 's/%2F/\//g' -e 's/+/ /g' -e 's/%3B/;/g' -e 's/%7E/~/g' -e 's/%3A/:/g' -e 's/%40/@/g' -e 's/%3D/=/g' -e 's/%2B/+/g')
+# Debug the filtering string
+# echo ${QUERY_STRING}
+
+
# Sending html header
cat "${_TEMPLATES}"/header.html
@@ -52,11 +60,6 @@ else
# Converting '=': sed 's/%3D/=/g'
# Converting '+': sed 's/%2B/+/g'
- # Translate parameters
- QUERY_STRING=$(echo "${QUERY_STRING}" | sed -e 's/%2F/\//g' -e 's/+/ /g' -e 's/%3B/;/g' -e 's/%7E/~/g' -e 's/%3A/:/g' -e 's/%40/@/g' -e 's/%3D/=/g' -e 's/%2B/+/g')
- # Debug the filtering string
- # echo ${QUERY_STRING}
-
# Email
_EMAIL=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])email=[-0-9a-zA-Z._@]+' | cut -f 2 -d '=' | head -n1)