X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=actions%2Fmultitag.sh;h=91a787b4a896130d17b414625dd4631d7bbfe995;hb=50ca23e58b678c818c2a8bb3a345136c1366047a;hp=5691b4fd8869c3dfe254ad2a53d956ecba64cb8c;hpb=6b08e359a06ed38d25c1756e5600096c77417a9c;p=serve0 diff --git a/actions/multitag.sh b/actions/multitag.sh index 5691b4f..91a787b 100755 --- a/actions/multitag.sh +++ b/actions/multitag.sh @@ -16,10 +16,10 @@ # 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) +filter="${_POST[f]}" +search="${_POST[s]}" +order=$(validate "${_POST[o]}" 'Name|Date|Length' Name) +page=$(validate "${_POST[pn]}" '[0-9]+' 1) addtag(){ meta="$1" @@ -41,7 +41,6 @@ $description EOF } -cgi_post n='' while [ -n "${_POST[tagsel$n]}" ]; do tagsel="${_POST[tagsel$n]}" @@ -53,7 +52,7 @@ while [ -n "${_POST[tagsel$n]}" ]; do done htmlsafe "${_POST[tags]}" printf \\n - ) |sed -r 's:\t| :_:g;s:^!|\r|\$|\^::g;' \ + ) | sed -r 's:\t: :g;s:^!|[\r\$\^\|]::g;' \ | while read tag; do addtag "${_DATA}/meta/$tagsel.meta" "$tag" done @@ -62,7 +61,7 @@ while [ -n "${_POST[tagsel$n]}" ]; do [ -z "$n" ] && n=0 || n=$(($n + 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"