2 # Copyright 2014 - 2016 Paul Hänsch
4 # This file is part of Serve0
6 # Serve0 is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Affero General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # Serve0 is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Affero General Public License for more details.
16 # You should have received a copy of the GNU Affero General Public License
17 # along with Serve0 If not, see <http://www.gnu.org/licenses/>.
19 order=$(validate "${_POST[o]}" 'Name|Length|Date' Name)
22 category="$(validate "${_POST[category$fn]}" '[[:alnum:]_-]+' none)"
24 n=''; while [ -n "${_POST[cfilter${fn}_$n]}" ]; do
25 #cfilter="$(validate "${_POST[cfilter${fn}_$n]}" '[[:alnum:]\?!\._=\(\)+-]+' '#')"
26 cfilter="${_POST[cfilter${fn}_$n]}"
29 [ -n "$filters" ] && filters="${filters}^"
30 [ "${_POST[type$fn]}" = 'neg' ] && filters="${filters}!"
36 [ "$category" = "none" ] && filters="${filters}${cfilter}" \
37 || filters="${filters}${category}:${cfilter}"
41 printf %s\\n "?o=${order}&f=${filters}" >>${_DATA}/meta/recent
42 redirect "?o=${order}&f=${filters}"