]> git.plutz.net Git - busy/blobdiff - actions/wikimeta.sh
upgraded to fit new shcgi revision, slightly better input validation, switched to...
[busy] / actions / wikimeta.sh
index 51236c9135599d7bc5fc61511016f61dc7f4415b..0a197192fa221f13ff671f288cf77ab5671295a1 100755 (executable)
@@ -19,7 +19,7 @@ $ACL_WIKIEDIT || echo "Location: ?p=Error&i=noaccess\n\n"
 $ACL_WIKIEDIT || exit 0 
 
 info="$(egrep -o '(^|&)i=[0-9]{10}_[0-9]{3}(&|$)' <<<"${QUERY_STRING}" |tr -d '&i=')"
-info="$(echo -E "$_GET[\"i\"]" |grep -Ex '[0-9]{10}_[0-9]{3}')"
+info="$(printf %s\\n "${_GET[i]}" |grep -Ex '[0-9]{10}_[0-9]{3}')"
 
 [ -z "$info" ] && info="$(date +%s)_$(apg -M N -a 1 -n 1 -m 3 -x 3)"
 descfile="$_DATA/Wiki/$info.meta"
@@ -29,10 +29,10 @@ commfile="$_DATA/Wiki/$info.comment.$(date +%s)_$(apg -M N -a 1 -n 1 -m 3 -x 3)"
 anchor=$(ls "$_DATA/Wiki" |grep -A2 $info |grep '.meta$' |tail -n1 |cut -d. -f1)
 
 cgi_post
-title="$_POST[\"title\"]"
-description="$_POST[\"desc\"]"
-comment="$_POST[\"comm\"]"
-[ -n "$_POST[\"cancel\"]" ] && cancel=true
+title="${_POST[title]}"
+description="${_POST[desc]}"
+comment="${_POST[comm]}"
+[ -n "${_POST[cancel]}" ] && cancel=true
 
 if [ -z "$cancel" -a -n "$comment" ]; then
   touch "$_DATA/Wiki/$info"