X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=actions%2Fmultitag.sh;h=b38b204ea0688bb21592d02d32d09c7bae1ca212;hb=d716f2ce1fe64cf87f777490315bc51906001c72;hp=242db282559fdb5d8c9c6a69d4e1d40eabc4487e;hpb=235877da7d36cb076fcbfed285b54ce967907642;p=serve0 diff --git a/actions/multitag.sh b/actions/multitag.sh index 242db28..b38b204 100755 --- a/actions/multitag.sh +++ b/actions/multitag.sh @@ -1,5 +1,5 @@ #!/bin/zsh -# Copyright 2014 - 2016 Paul Hänsch +# Copyright 2014 - 2017 Paul Hänsch # # This file is part of Serve0 # @@ -16,10 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with Serve0 If not, see . -filter="${_GET[f]}" -search="${_GET[s]}" -order=$(validate "${_GET[o]}" 'Name|Date|Length' Name) -page=$(validate "${_GET[pn]}" '[0-9]+' 1) +backlink="${_POST[page]}" addtag(){ meta="$1" @@ -41,7 +38,6 @@ $description EOF } -cgi_post n='' while [ -n "${_POST[tagsel$n]}" ]; do tagsel="${_POST[tagsel$n]}" @@ -59,10 +55,10 @@ while [ -n "${_POST[tagsel$n]}" ]; do done rm "${_DATA}/cache/$tagsel.cache" 2>/dev/null - [ -z "$n" ] && n=0 || n=$(($n + 1)) + n=$((${n:--1} + 1)) done -rm "${_DATA}"/cache/*[0-9]\?* 2>/dev/null -[ -n "${_POST[tags]}" ] && rm "${_DATA}"/cache/taglist 2>/dev/null +rm "${_DATA}"/cache/\?* 2>/dev/null +[ -n "${_POST[tags]}" ] && rm "${_DATA}"/cache/taglist_set "${_DATA}"/cache/taglist_filter 2>/dev/null -redirect "?o=$order&s=$search&f=$filter&pn=$page" +redirect "$backlink#$tagsel"