X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=actions%2Fmeta.sh;h=1895f1dddc148e99f5476d5c1f37d7d871a576bc;hb=0619bc447c21ac196734848ae3b0aa786b6eb1ee;hp=6de9f3890db1b8f77c9fbca22dd464a45d34fc9a;hpb=f6d9912760f1c53189c0928ef58a7ff6a158a768;p=serve0 diff --git a/actions/meta.sh b/actions/meta.sh index 6de9f38..1895f1d 100755 --- a/actions/meta.sh +++ b/actions/meta.sh @@ -1,31 +1,31 @@ #!/bin/zsh -info="$_GET[\"i\"]" -order="$_GET[\"o\"]" -search="$_GET[\"s\"]" -filter="$_GET[\"f\"]" -page="$_GET[\"p\"]" + info="${_GET[i]}" + order="${_GET[o]}" +search="${_GET[s]}" +filter="${_GET[f]}" + page="${_GET[pn]}" file="${_DATA}/meta/$info.meta" cgi_post -length="$_POST[\"length\"]" -width="$_POST[\"width\"]" -height="$_POST[\"height\"]" -trash="$_POST[\"trash\"]" -cancel="$_POST[\"cancel\"]" -tagacc="$_POST[\"tag\"]" -tags="$(echo "$_POST[\"tags\"]" \ +length="${_POST[length]}" + width="${_POST[width]}" +height="${_POST[height]}" + trash="${_POST[trash]}" +cancel="${_POST[cancel]}" +tagacc="${_POST[tag]}" +tags="$(echo "${_POST[tags]}" \ | sed -r 's:\t| :_:g;s:^!|\r|\$|\^::g;s:\\:\\\\:g;s//\>\;/g' )" -description="$(echo -e "$_POST[\"description\"]" \ +description="$(echo -e "${_POST[description]}" \ |sed 's/\r//g;s/\\/\\\\/g;s//\>\;/g' )" -n=0; while [ -n "$_POST[\"tag$n\"]" ]; do - tagacc="$_POST[\"tag$n\"]|$tagacc" +n=0; while [ -n "${_POST[tag$n]}" ]; do + tagacc="${_POST[tag$n]}|$tagacc" n=$(($n + 1)) done -[ -z "$cancel" ] && if [ -n "$trash" ]; then +[ -z "$cancel" -a -n "$info" ] && if [ -n "$trash" ]; then rm "${_DATA}/thumbs/$info.jpg" 2>/dev/null mv "${_DATA}/videos/$info" "${_DATA}/meta/$info.meta" "${_DATA}/trash/" 2>/dev/null rm "${_DATA}/cache/$info.cache" 2>/dev/null @@ -40,4 +40,4 @@ else rm ${_DATA}/cache/taglist 2>/dev/null fi -echo -n "Location: ?i=&p=${page}&s=${search}&f=${filter}&o=${order}#$info\n\n" +echo -n "Location: ?i=&pn=${page}&s=${search}&f=${filter}&o=${order}#$info\n\n"